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

Edit modal popup once item has been added to cart?

Started by mailblade, October 07, 2017, 15:27:09 PM

Previous topic - Next topic

mailblade

Hey guys.

I just have one question:

You know once you add a product to the cart a modal box appears saying how much of the product you added? Then you can click "Continue Shopping"; "Show Cart" or press the "X" to close the modal window.

Now, once I click the continue shopping, the page refreshes and goes to the top of my product list. How can I make it refresh without going to the top of the page again? Let's say I scrolled down 50 products and add product no 51 to the cart and click "Continue Shopping" , I would lose my location and at which product I am. Then I'll have to scroll down all the way again and find the specific product.

Can the refresh automatically go back to the location I was on the weg page? This is for the category view.

Thanks for reading :)

jenkinhill

You can use JavaScript to simulate the browser back arrow function - Google for some code examples.

The file to edit &override is components/com_virtuemart/views/cart/tmpl/padded.php  (unless you already use overrides).
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

mailblade

#2
Thanks a lot jenkinhill, you're a lifesaver.

I'll just put a Javascript refresh function which refreshes the page. This will then keep me at the location I already was in the webpage.

The main issue was, I didn't know which file to edit for the modal popup. Now I do know it is the "padded.php".

Cheers!  :)

For those wondering, I just added this:

href="javascript:window.location.reload();"

jenkinhill

Or   window.history.back()  would probably work, too.
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

mailblade

Yeah that one does work as well!

If you don't mind, I have another question:

Is there a way I can show the cart quantity for each product in the category view?

I'd like to add a small note in the category layout for each product which says: "Currently in cart - 5"

How would I go about that? I'd rather not make a full new topic as it feels I'm asking too many questions.

jenkinhill

That would probably need a plugin to be developed. I suspect that is not likely to be a commercial venture due to low demand (I believe you are the first to ask for it) and it would have to contend with the many types of different templates used.
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

mailblade

Thanks a lot for your reply jenkinhill.

I understand, will have to look at plugins.

Studio 42

I don't think a plugin exist.
You need to check with a developper as me or perhaps GJC Web Design(or any developer answering many time in the forum)