News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

HELP:Manually Add to Cart using standalone PHP code in Joomla

Started by stoddsie, October 12, 2012, 14:38:23 PM

Previous topic - Next topic

stoddsie

I have some standalone (non virtuemart pages) which I wish to add a "Add to cart" button for a given product.

I know what the id of the product is, along with Qty, Category price etc.

Is there anyway I can create my own button that does the same as the normal "add to cart" buttons. I managed to achieve this in VM 1.1.9 by manually adding my own values to the Session 'cart'. However, this same code does not work any longer as the session structure is much different. I could try and recreate the session but there are lots of values, and I cannot determine what the bare mininium is.

Ideally I would like to be able to call an existing "Add to cart" method from the Virtuemart classes, but am unsure how to do this. Presumably I would need to include a series of Joomla and Virtuemart core files in my standalone code, and then pass a series of values to the add to cart method.

I would be really grateful if anyone could help here - perhaps you have already achieved this and know what code to use.

I look forward to your replies.

Regards

James

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum


bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!