dbfriends Posted March 16, 2008 Posted March 16, 2008 Hi, I'm currently using osCommerce for my first commercial project, and I'm really impressed with it. I'm wondering if anyone can help me with the one problem I'm still having, though... I'm creating a photography site for a client, and have got 99% of the coding done. I've even written something so that uploaded images are automatically added to the products list, given an ID, and a downloadable full-size version is put into the appropriate folder. The only problem I'm having is that the client wants to have an "Add to shopping cart" HTML link underneath pictures in his main gallery - not just within osCommerce itself. The site uses lots of Ajax, and at the moment I've got it set up so that clicking the link loads the URL: catalog/product_info.php?action=add_product&cPath=55&products_id=4 It also sends "id[1]=1&products_id=4" as POST data, to emulate the button being clicked. Then things start getting weird. If I go to the shopping cart, the subtotal suggests that the images have been added (ie it goes up each time I click) - but they're not visible, so can't be deleted and so on. Am I missing something really obvious? Thanks in advance for any help!
box25 Posted March 16, 2008 Posted March 16, 2008 This could be because the add_product looks for the products_id as posted variable hidden within a form. try the follwoing instead /catalog/produict_info.php?products_id=PRODUCTS_ID&action=buy_now Just change the PRODUCTS_ID to the ID you want to add.
dbfriends Posted March 19, 2008 Author Posted March 19, 2008 This could be because the add_product looks for the products_id as posted variable hidden within a form. try the follwoing instead /catalog/produict_info.php?products_id=PRODUCTS_ID&action=buy_now Just change the PRODUCTS_ID to the ID you want to add. Thanks for the suggestion. I tried that, but it didn't seem to add anything at all? Anything else I could try?
dbfriends Posted March 28, 2008 Author Posted March 28, 2008 Just to add to this topic, in case it's of any use to someone else. I still don't know why the first example I gave wasn't working, but the reason the buy_now one wasn't behaving is because my product had attributes (in my case, Download: Immediately) that needed to be chosen from the drop-down box.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.