Author Topic: Edit modal popup once item has been added to cart?  (Read 330 times)

mailblade

  • Jr. Member
  • **
  • Posts: 56
  • A beginner
Edit modal popup once item has been added to cart?
« on: October 07, 2017, 15:27:09 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26428
  • Always on vacation
    • Jenkin Hill Internet
Re: Edit modal popup once item has been added to cart?
« Reply #1 on: October 07, 2017, 15:56:00 pm »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.8 on Joomla 3.8.3 PHP 7.0.25

Testing VM3.2.8.9695 on J3.8.3

mailblade

  • Jr. Member
  • **
  • Posts: 56
  • A beginner
Re: Edit modal popup once item has been added to cart?
« Reply #2 on: October 07, 2017, 16:17:05 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26428
  • Always on vacation
    • Jenkin Hill Internet
Re: Edit modal popup once item has been added to cart?
« Reply #3 on: October 07, 2017, 16:32:32 pm »
Or   window.history.back()  would probably work, too.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.8 on Joomla 3.8.3 PHP 7.0.25

Testing VM3.2.8.9695 on J3.8.3

mailblade

  • Jr. Member
  • **
  • Posts: 56
  • A beginner
Re: Edit modal popup once item has been added to cart?
« Reply #4 on: October 07, 2017, 16:39:56 pm »
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26428
  • Always on vacation
    • Jenkin Hill Internet
Re: Edit modal popup once item has been added to cart?
« Reply #5 on: October 07, 2017, 17:26:50 pm »
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

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM3.2.8 on Joomla 3.8.3 PHP 7.0.25

Testing VM3.2.8.9695 on J3.8.3

mailblade

  • Jr. Member
  • **
  • Posts: 56
  • A beginner
Re: Edit modal popup once item has been added to cart?
« Reply #6 on: October 08, 2017, 08:22:46 am »
Thanks a lot for your reply jenkinhill.

I understand, will have to look at plugins.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2432
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Edit modal popup once item has been added to cart?
« Reply #7 on: October 12, 2017, 14:45:11 pm »
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)