Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I would love to get a continuos shopping button in the shopping cart, which brings the user back to the last product page he has been.
Kirk
Comment | File | Size | Author |
---|---|---|---|
#22 | cart.png | 16.86 KB | bhans@zoominternet.net |
Comments
Comment #1
rszrama CreditAttribution: rszrama commentedHmm, it's a fine idea for a feature, but given the way Drupal Commerce approaches products / product displays in core, I don't think we'll be adding any core functionality for this. A contrib could be made that provides this feature for sites that do use the product display node paradigm, though. And I suppose alternate sub-modules of the same project could provide other ways of setting the link.
In the meantime, the easiest thing to do is just alter the link onto the form or even figure out a way to add it directly in Views.
Comment #2
zorroposada CreditAttribution: zorroposada commentedI wanted to add a "Continue Shopping" button to the cart form.
I have seen this button in most of the e-commerce sites. Visitors are used to see it in the cart form.
The default behaviour for this button is to take you to the product page or to the product list page depending on how you arrived to the cart form page.
I have seen this button in apple.com and criterion.com
Comment #3
mediapal CreditAttribution: mediapal commentedThank you for this one.
Works perfect.
Comment #4
andyh69uk CreditAttribution: andyh69uk commentedI apologise in advance for my question but I rarely change views and can't for the life of me remember where I should put that code, I have spent ages looking on the internet with no success, please help. Where do I put that code?
Comment #5
mediapal CreditAttribution: mediapal commentedThe code doesn't go some where like this. You take the code and build your own custom module with it.
In MYMODULE_form_views_form_commerce_cart_form_default_alter you replace "MYMODULE" with your module name.
A module folder contains at least a my_module.info and a my_module.module file.
Comment #6
andyh69uk CreditAttribution: andyh69uk commentedThank you, working perfectly
Comment #7
deggertsen CreditAttribution: deggertsen commentedYes, thank you. This really should be an option by default in drupal commerce. In fact it would be best if it was committed because if somebody didn't want it for some weird reason, they could simply use css to hide it.
Marking as needs review. Maybe it needs work since #2 technically isn't a patch, but I don't think a patch is necessary. If it is then I'm pretty sure I could make one.
Also, I don't think it is necessary that this would be a contributed module, so I'm marking it back to user experience. Correct me if I'm wrong.
Comment #8
vasikeseems we have a duplicate #1308582: Customize Checkout Pages: Page names, pages order, buttons labels, help text, new custom pagesCould Commerce Checkout Pages module be a part of Drupal Commerce, so the checkout pages titles, buttons or others could be configurable from UI?Comment #9
deggertsen CreditAttribution: deggertsen commentedAt a glance at the other issue it does not appear to be a duplicate. If I understand correctly that issue is talking about making the checkout process more clear while this issue is simply to create a "continue shopping" button which would send them back to where they were shopping in order to allow them to add more products to their cart. In this case continue shopping does not mean proceed to checkout, it means lets go back so that we can add more stuff to our cart!
Correct me if I'm wrong.
Comment #10
vasikenothing to correct. definitely my mystake. sorry about that.
Comment #11
rszrama CreditAttribution: rszrama commentedYeah, "needs review" is only for issues that actually have patches. That said, I'm still not convinced this needs to be a core feature, especially if there's a way to demonstrate how to do this with Views on its own. It's simply not a requirement for too many types of eCommerce sites to make it something people have to hack around to disable (i.e. using CSS).
At the very least, I wouldn't put something like this in core unless it was configurable, most likely through a custom Views area handler. Often it's easiest for elements like that to develop in contrib and find their way into core after they've been proven "in the wild", but we can make this back into a feature request for core if someone wants to come up with an area handler and an appropriate patch to the core shopping cart form.
Comment #12
ahimsauziThis is such an important super must have functionality!
Works like a charm. Thank you so much for posting this solution.
~Uzi
Comment #13
andersiversen CreditAttribution: andersiversen commentedThe code posted works great - thanks! :)
Though if the shopping cart is empty there's no button. How do I get the button to display even though the cart is empty?
Comment #15
sprankles CreditAttribution: sprankles commentedThis worked very well for me. I had one issue that I need help with. When I remove an item from my cart and choose continue shopping it causing the item be placed back in the cart as that is the last page that was loaded. Is there an adjustment that needs to be made to the else statement to remedy this? Thanks.
Comment #16
Willysino CreditAttribution: Willysino commentedMuchas gracias zorro.
Es genial.
Comment #17
Willysino CreditAttribution: Willysino commentedmysoftmusic, thank you very much, for you "mini how" is great.
Ok deggertsen, I am agree with you.
Comment #18
vasikeWhat about Commerce add to cart confirmation module?
Could this module be considered as the solution for this issue?
Comment #19
webmaster@girija CreditAttribution: webmaster@girija commentedThank you very much zorroposada...
That works fine.
Thank you very much
Comment #20
blueblot CreditAttribution: blueblot commentedThanks zorroposada
works fine.
Comment #21
basscleff94010 CreditAttribution: basscleff94010 commentedRyan, can you provide more details of where in the View: Commerce add to cart confirmation the link back to the source is set? Its not clear from just looking at the View.
Thank you.
Paul
Comment #22
bhans@zoominternet.net CreditAttribution: bhans@zoominternet.net commentedI know this is very old, but there is an easy way. Edit the cart view. Add a 'Global:Text area' to the Footer. Insert an 'a href' link in the text area you just created linking back to your products listing or wherever you want them to go back to continue shopping. Oh, make sure you have full html for the editor here. Here is an example for a bootstrap based theme:
<a href="/products" class="btn btn-primary" role="button">Continue Shopping</a>
It takes back to my "products" landing page. Nice thing with bootstrap, using the btn will automatically make it a button for you. If not bootstrap, you can add some css to format it.
Also, a little more css and you can get the continue shopping button on the same line as the checkout.
Comment #24
Chris Matthews CreditAttribution: Chris Matthews commented@bhans...
Could you add to your example above based on a bootstrap theme that would put the continue shopping button on the same line?
Much appreciated,