darren62 Posted May 6, 2010 Share Posted May 6, 2010 I am trying to replicate one of my sites in PS so that I can move over from the shop I am using to PS but I am having difficulty trying to use an image to add the product to the basket.This site only has one product so I don't actually show the product page just different cms pages for information.So I have an easy order button and another image that just says order now that I want to attach my product id to so once it is clicked it adds it to the basket and shows the cart. Most visitors are return vistitors and know that product so just want to click the button to add to basket.Having used PS on two other sites I intend to use it on all of my sites but this little problem is holding me back from doing that.Is it possible to use code that can be attached to the image to do this? Link to comment Share on other sites More sharing options...
darren62 Posted July 8, 2010 Author Share Posted July 8, 2010 Is there anyone that knows how to do this?I have virtually themed my Prestashop at www.evolutionsuperfood.co.uk but cannot find out how to get it so that the button on the right adds the products to the basket as well as the ones in the write up throughout the front page.Is it possible that someone could tell me which code I need to make it so that the buttons can be used as custom add to cart buttons and also if possible which code to use for the quantity.Can I do this as the add to cart button and quantity is a form?If not could someone tell me how to add this form in any part of the site as that would be better. I can't change the site too much as it needs to look like the live site at www.monatomicgold.co.uk. Link to comment Share on other sites More sharing options...
rocky Posted July 9, 2010 Share Posted July 9, 2010 I had a look at the link on the "Easy order, Click here" button, and it is only cart.php. You need to put a link like the following on it: {$base_dir}cart.php?add&id_product=1&token={$static_token} This will add one of product 1 to the cart. Change 1 to the ID of your product. Link to comment Share on other sites More sharing options...
darren62 Posted November 24, 2010 Author Share Posted November 24, 2010 Hi RockyBit of a delay I am afraid as I have been busy trying to get my visa application in to go to Oz but I am now back on the site as I need to get it working for when I go (fingers crossed).I have made my new site at www.monatomicgold.co.uk/ps and have created a button in a second addstuff block but how do I put the code you put here behind the image so it adds to basket when clicked.Also, I have been trying without any success at all to put the price under the image of the product but it either throws an error or when the visitor changes the currency it doesn't change it. Link to comment Share on other sites More sharing options...
rocky Posted November 27, 2010 Share Posted November 27, 2010 You need to change: <img src="http://www.monatomicgold.co.uk/ps/img/easy_order.gif" alt="one_click_order_button" /> to: <a href="{$base_dir}cart.php?add&id_product=1&token={$static_token}"><img src="http://www.monatomicgold.co.uk/ps/img/easy_order.gif" alt="one_click_order_button" /> Change 1 to the ID of the "Evolution: The Vital Link" product. Link to comment Share on other sites More sharing options...
darren62 Posted November 27, 2010 Author Share Posted November 27, 2010 Used that code and it came up with an error..The requested URL /ps/{$base_dir}cart.php was not found on this server. Link to comment Share on other sites More sharing options...
darren62 Posted November 27, 2010 Author Share Posted November 27, 2010 Hi RockyCould the fact that the product is category 2 product 1 have anything to do with it and not just product 1?CheersDarren Link to comment Share on other sites More sharing options...
rocky Posted November 27, 2010 Share Posted November 27, 2010 The Smarty codes aren't working. Does the "Add Stuff" module ignore them? Does the module have a TPL file you can edit to put the code in? It is possible to hardcode the shop URL, but not the token. Link to comment Share on other sites More sharing options...
darren62 Posted November 27, 2010 Author Share Posted November 27, 2010 I Don't know if the addstuff ignores the smarty code but it just reads a html file or what you specify in the admin section. Link to comment Share on other sites More sharing options...
darren62 Posted November 27, 2010 Author Share Posted November 27, 2010 If the addstuff ignores the smarty code would that explain why I can put the code in for the price of the product but it doesn't change when I change currency? Link to comment Share on other sites More sharing options...
rocky Posted November 27, 2010 Share Posted November 27, 2010 It depends how you are writing the price? Are you writing it as a value or a variable? Link to comment Share on other sites More sharing options...
darren62 Posted November 27, 2010 Author Share Posted November 27, 2010 TBH Rocky I have no idea. I was just copying it from the product source code.Do I have to put any tags in the html file for it to read the smarty code. Sorry if I am asking obvious Q's but my knowledge on code is very limited. Link to comment Share on other sites More sharing options...
darren62 Posted November 29, 2010 Author Share Posted November 29, 2010 There is a tpl file but all it has in it is;<!-- MODULE Addstuff --> {$addstuff2_code} <!-- /MODULE Addstuff -->I tried a different way to do this by saving product.tpl as product1.tpl, removing all of the code and then putting your code in and then putting product1.tpl in the addstuff instead of the addstuff tags.Although it didn't work it didn't come up with the same error. It came up with an error that the product didn't exist.I then copied the product from category 2 to the home section so it was (if I have it right) product 1 but it still said that the product didn't exist.Doesn't matter what I do though I can't get the price od product 1 - there is only 1 product) in the tpl file to change at all.Can anyone out there shed any more light on how I can do this as I want my new site to look like as much like the old one as possible Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now