How can use add to cart button on externa php file

  • Posts: 120
  • Thank you received: 2
9 years 7 months ago #227876

-- HikaShop version -- : 2.6.x
-- Joomla version -- : 3.4.8

Hi dear
I develop my custom extension and and need add hikashop add to cart button in my php file.
How can do it? thank you.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 7 months ago #227887

Hi,

When editing a product in the backend, you can find a button "Add to cart HTML link" in the toolbar.
This will give you the code of a button to add this specific product to the cart, so you can use it and adapt it with some PHP to have to correct product ID and quantity.

Here is an example of code for that button:

<a class="hikashop_html_add_to_cart_link" href="http://website.com/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=4">Add to cart</a>

The following user(s) said Thank You: kaya

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

  • Posts: 120
  • Thank you received: 2
9 years 7 months ago #228067

Thank you dear Xavier

Now I used your code and not load hikashop framework on my php file?

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
9 years 7 months ago #228077

Hi,

I'm afraid that I do not understand your message.
Xavier gave you a working code ; you do not need more to make it work.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.076 seconds
Powered by Kunena Forum