Guest Posted December 17, 2004 Posted December 17, 2004 Hi, I have been searching for a while now but still have not had any luck... I was wondering if anyone knew how to change the BUY NOW buttons to ADD TO Cart ? I want visitors to be able to add products to the cart without being redirected to the shoppingcart.php. Hope someone can help. Thanks for your time.
stevel Posted December 17, 2004 Posted December 17, 2004 Perhaps all you want is to set Admin..Configuration..My Store..Display Cart After Adding Product to false? Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted December 17, 2004 Posted December 17, 2004 Its so easy when you know how. That's exactly what I wanted. Thanks very much. :thumbsup:
Guest Posted December 18, 2004 Posted December 18, 2004 Ahhh! Just noticed that if you add a downloadable product it when pressing buy now it redirects you to productinfo.php :'( Anyway of not redirecting to this? All I want to try and achieve is to only have products added to the cart without any redirections whatsoever - even if its a downloadble product... Thanks
stevel Posted December 19, 2004 Posted December 19, 2004 It has to redirect to SOMEWHERE, even if it's the same page, otherwise the context won't be refreshed. I don't use Buy Now buttons so I'm not entirely sure how they work - last I knew, they simulated someone pressing Add to Cart on a product page. I've read of a change that makes Buy Now buttons be forms that are submitted, but I don't know the details. Look in the contributions. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted December 19, 2004 Posted December 19, 2004 Yes, even getting the page to be redirected/refreshed to the same page as you say would be perfect... It works fine when a product has no attributes... When I add an attribute which is only stating the download file name the catalogue then redirects to another page... (productinfo.php)
stevel Posted December 19, 2004 Posted December 19, 2004 Ah, I see, The code that processes Buy Now, which you can find in includes/application_top.php at around line 363, decides that it csn't handle the request if the product has attributes, so it just redirects to the product_info page so that the customer can select the attributes and then select Add To Cart. I don't know anything of how download products work, so I don't know if there's a way around this. Someone else will have to help with that. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted December 19, 2004 Posted December 19, 2004 Ah, I see,? The code that processes Buy Now, which you can find in includes/application_top.php at around line 363, decides that it csn't handle the request if the product has attributes, so it just redirects to the product_info page so that the customer can select the attributes and then select Add To Cart. I don't know anything of how download products work, so I don't know if there's a way around this.? Someone else will have to help with that. <{POST_SNAPBACK}> Yes... I just see where it tells it to redirect if the product has an attribute. I will ask around, see if anyone knows how to make a product that has the download attribute not redirect to product_info.php just ignore the command and add it to the cart as if it had no attributes... - Thanks Stevel
Guest Posted December 19, 2004 Posted December 19, 2004 Yes... I just see where it tells it to redirect if the product has an attribute.I will ask around, see if anyone knows how to make a product that has the download attribute not redirect to product_info.php just ignore the command and add it to the cart as if it had no attributes... - Thanks Stevel <{POST_SNAPBACK}> Around line 361 i have deleted the line where it tells it to redirect to prduct_info.php - it now just adds the product to the cart without any problems.
stevel Posted December 19, 2004 Posted December 19, 2004 But does the attribute get added to the order? Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted December 19, 2004 Posted December 19, 2004 But does the attribute get added to the order? <{POST_SNAPBACK}> Hmmm, There is no attributes - it is just a downloadable file.
stevel Posted December 19, 2004 Posted December 19, 2004 How does it know which file to download, then? Does it get picked up automatically? I've never used this feature in osC so I am unfamiliar with it. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted December 19, 2004 Posted December 19, 2004 How does it know which file to download, then? Does it get picked up automatically? I've never used this feature in osC so I am unfamiliar with it. <{POST_SNAPBACK}> Yes you may be right again... I am going to check if the file is available...
Guest Posted January 16, 2005 Posted January 16, 2005 How does it know which file to download, then? Does it get picked up automatically? I've never used this feature in osC so I am unfamiliar with it. <{POST_SNAPBACK}> You were right, when I remove the line where it tells it to redirect it does not provide a download link, like you say it needs to know the product attribute. It is a shame really - however it does work if you are not selling any downloadable products - I will ask around - But it sounds like there is slim chance this can be done unless you have extensive programming knowledge which I haven't got. Thanks for your help. :thumbsup:
stevel Posted January 17, 2005 Posted January 17, 2005 I was helping someone else with a somewhat related issue, and in the process I learned a bit more how this stuff works. There is code in application_top.php that processes the "add to cart" request, and there is a POST variable for each option, with a name such as "id[2]" with values. If you can determine what the correct name is (look at the source of your product page for the product and look for the form field for the download name, which will be hidden), then add it to the request passed on when the BuyNow button is clicked, you should get what you want. It may be simplest if you convert the BuyNow into a form (there is a contrib for this in the context of preventing spiders from adding to the cart) and then just add the proper hidden form field. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted January 21, 2005 Posted January 21, 2005 I was helping someone else with a somewhat related issue, and in the process I learned a bit more how this stuff works. There is code in application_top.php that processes the "add to cart" request, and there is a POST variable for each option, with a name such as "id[2]" with values. If you can determine what the correct name is (look at the source of your product page for the product and look for the form field for the download name, which will be hidden), then add it to the request passed on when the BuyNow button is clicked, you should get what you want. It may be simplest if you convert the BuyNow into a form (there is a contrib for this in the context of preventing spiders from adding to the cart) and then just add the proper hidden form field. <{POST_SNAPBACK}> Great thanks! At least now I know where I am going... I found someone else trying to do exactly what I want to do and someone who replied to his post said a similar solution to what you mention above... I have tried contacting the guy but have had no reply... Thanks Stevel
Guest Posted January 21, 2005 Posted January 21, 2005 Great thanks! At least now I know where I am going...I found someone else trying to do exactly what I want to do and someone who replied to his post said a similar solution to what you mention above... I have tried contacting the guy but have had no reply... Thanks Stevel <{POST_SNAPBACK}> Hey take a look and tell me what you think of it... Downloads MP3 If you notice when you browse to the uk hip hop category you will get a nice list of the mp3s with a choice of listening or adding to cart (GET) - this is why I really don't want a visitor being sent to the product page as its a waste of time... There is a few bugs that I still need to fix most noticeable is the 'n' characters that appear when going to a category... Thanks
stevel Posted January 21, 2005 Posted January 21, 2005 You aren't using the File Manager in admin to do the editing, are you? I don't see that you're including any attributes in your BuyNow button. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted January 21, 2005 Posted January 21, 2005 You aren't using the File Manager in admin to do the editing, are you? I don't see that you're including any attributes in your BuyNow button. <{POST_SNAPBACK}> I have only used the file manager for editing lanuguage/english.php & index.php For the rest I am using notepad... I will look and see if I can add the attributes to buy button now...
Guest Posted February 12, 2005 Posted February 12, 2005 I was helping someone else with a somewhat related issue, and in the process I learned a bit more how this stuff works. There is code in application_top.php that processes the "add to cart" request, and there is a POST variable for each option, with a name such as "id[2]" with values. If you can determine what the correct name is (look at the source of your product page for the product and look for the form field for the download name, which will be hidden), then add it to the request passed on when the BuyNow button is clicked, you should get what you want. It may be simplest if you convert the BuyNow into a form (there is a contrib for this in the context of preventing spiders from adding to the cart) and then just add the proper hidden form field. <{POST_SNAPBACK}> Hi Stevel, Did the person you were helpinh manage to pull it off? I have had no luck :( As I mentioned earlier I am a PHP novice so I get slighly confused... I have luck with contributions as most of them come with instructions...
stevel Posted February 12, 2005 Posted February 12, 2005 I don't think I heard back on it - sorry. I don't think it's too difficult once you understand what needs to happen. If I didn't have half a dozen "features" MY store needs in progress, I might give it a whack, but I otherwise have no interest in this one. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
Guest Posted February 12, 2005 Posted February 12, 2005 I don't think I heard back on it - sorry. I don't think it's too difficult once you understand what needs to happen. If I didn't have half a dozen "features" MY store needs in progress, I might give it a whack, but I otherwise have no interest in this one. <{POST_SNAPBACK}> No not at all. You never know unless you ask. I apriciate your replies... Thanks. I will keep on trying! :thumbsup:
oscommerceking Posted May 28, 2005 Posted May 28, 2005 Perhaps all you want is to set Admin..Configuration..My Store..Display Cart After Adding Product to false? <{POST_SNAPBACK}> I am attempting to change the buy it now column to merely add to cart column just like when you do a manufacturers search any ideas where to start T I A J My Contributions: Add Search + Drop Down Anywhere, Eliminate Subcategories in Drop Down
stevel Posted May 28, 2005 Posted May 28, 2005 Well, you start in includes/modules/product_listing.php - this is where the column is displayed. If you simply want to change the title and the button image, that's easy. However, the only difference between Add to Cart and Buy It Now is that the latter can't deal with a product that has attributes (options), so it redirects you to the product page to select them, so I am unsure what you are trying to accomplish. Steve Contributions: Country-State Selector Login Page a la Amazon Protection of Configuration Updated spiders.txt Embed Links with SID in Description
oscommerceking Posted May 28, 2005 Posted May 28, 2005 Well, you start in includes/modules/product_listing.php - this is where the column is displayed. If you simply want to change the title and the button image, that's easy. However, the only difference between Add to Cart and Buy It Now is that the latter can't deal with a product that has attributes (options), so it redirects you to the product page to select them, so I am unsure what you are trying to accomplish. <{POST_SNAPBACK}> Simply, the "buy it now", phrase is improper wording, add to cart would be more proper considering what i am trying to accomplish Thanks for a quick response (ps any idea how i could get the red x's to appear without images, and the items i have with images to appear thus ?? ) Again TIA J My Contributions: Add Search + Drop Down Anywhere, Eliminate Subcategories in Drop Down
Recommended Posts
Archived
This topic is now archived and is closed to further replies.