Getting Cart variables

  • Posts: 22
  • Thank you received: 1
9 years 8 months ago #195960

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.3
-- PHP version -- : 5.5

Hi

I need to integrate Hikashop with "Pay With Amazon". For this I need to place an Amazon checkout button at the first step of the checkout process, ( like Paypal Express checkout) . The first step is the login page.

On this page, I need to match the variables of the products in the cart with the XML required for Amazon. The amazon XML is:

private function getCartXML($merchantID, $awsAccessKeyID) {
return
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" .
"<Order xmlns=\" payments.amazon.com/checkout/2008-06-15/\ ">" .
" <ClientRequestId>123457</ClientRequestId>" .
" <Cart>" .
" <Items>" .
" <Item>" .
" <SKU> .$SKU. </SKU>" .
" <MerchantId>" . $merchantID . "</MerchantId>" .
" <Title> .$product_title. </Title>" .
" <Description> .$product_description.</Description>" .
" <Price>" .
" <Amount>$product_price.</Amount>" .
" <CurrencyCode>INR</CurrencyCode>" .
" </Price>" .
" <Quantity> $quantity. </Quantity>" .
" <Weight>" .
" <Amount> $weight. </Amount>" .
" <Unit>grams</Unit>" .
" </Weight>" .
" <Category> $product_category. </Category>" .
" </Item>" .
" </Items>" .
" </Cart>" .
"</Order>";

}

Can anyone please guide me on how o get the ordered product details on the checkout login page...

Thanks in advance

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #195969

Hi,

I don't think that adding such kind of code in a view will be enough.
This will require a plugin, paypal express is handled by a plugin.

By adding code in the view, you could maybe send informations to Amazon payment gateway, but you will never have any returns form amazon to your shop, so no validation of the order, etc..

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 3
9 years 5 months ago #202977

I am currently using Breezing Forms with a custom cart to populate an order form on the home for a product that has three offers. The customer picks one of the three offers and fills in their name...contact info...and clicks the submit button where they are taken to the checkout page. This is the current code that handles populating the variables. Can you fix this so I can convert from the custom cart to Hikashop?

$this->execPieceByName('ff_InitLib');

echo '
<form name="Form1" action=" www.safesecureprocessing.com/ " method="post">
<input name="capture" size="1" type="hidden" value="1" />
<input type="hidden" name="website" value="691"/>
<input type="hidden" name="BILLING_COUNTRY_REQ" value="223"/>
<input type="hidden" name="billing_fname_req" value="'.htmlentities( ff_getSubmit('billing_fname_req') ).'"/>
<input type="hidden" name="billing_lname_req" value="'.htmlentities( ff_getSubmit('billing_lname_req') ).'"/>
<input type="hidden" name="billing_address_req" value="'.htmlentities( ff_getSubmit('billing_address_req') ).'"/>
<input type="hidden" name="billing_city_req" value="'.htmlentities( ff_getSubmit('billing_city_req') ).'"/>
<input type="hidden" name="billing_state_req" value="'.htmlentities( ff_getSubmit('billing_state_req') ).'"/>
<input type="hidden" name="billing_zip_req" value="'.htmlentities( ff_getSubmit('billing_zip_req') ).'"/>
<input type="hidden" name="billing_email_req" value="'.htmlentities( ff_getSubmit('billing_email_req') ).'"/>
<input type="hidden" name="billing_phone_req" value="'.htmlentities( ff_getSubmit('billing_phone_req') ).'"/>
<input type="hidden" name="product_id" value="'.htmlentities( ff_getSubmit('product_id') ).'"/>

</form>
<script>
document.Form1.submit();
</script>
';

exit;

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
9 years 5 months ago #202990

Hi,

Why not simply have a product page in HikaShop with a characteristic for the selection of the offer, and custom item fields for the billing address fields ?

Otherwise, there is no form action of HikaShop you can use in order to add a product to the cart and at the same time fill in a billing address, so you can't just modify that code to fit with HikaShop.

The following user(s) said Thank You: tbroderick

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum