Author Topic: Multiple Cart Modules  (Read 3443 times)

trevorbicewebdesign

  • Beginner
  • *
  • Posts: 16
    • Trevor Bice Webdesign
Multiple Cart Modules
« on: September 12, 2015, 07:13:49 am »
Hi,

I've been working with Virtuemart for a number of years now, and have encountered an issue on the latest 3x version that I wanted to share.

It seems that there is difficulty with the default Virtuemart Cart module if you are attempting to use more than just one of them. Either I am missing something, or maybe I am the only person who likes to have ajax updated aspects of the cart available in multiple places on a site! When doing this with the current version, it really just breaks everything and doesn't work as expected. When clicking 'add to cart' only one of however many Cart modules you have set up will update properly. I have researched this, and its mostly due to how the update_cart.js file is written.

I have re-written this in a way that lets you have as many Cart modules set up as you wish. As a longtime developer, and user of this software -- I'd love to help give something back!

https://github.com/trevorbicewebdesign/Virtuemart3-Cart---mod_virtuemart_cart

Its nothing fancy, but it works a little better than before. Maybe someone else will find this useful.

     - Trevor

Never underestimate the power of stupid people in large groups.
http://webdesign.trevorbice.com/

K&K media production

  • VirtueMart Developer Team
  • Global Moderator
  • Full Member
  • *
  • Posts: 830
  • VirtueMart Version: VM3 on J3
Re: Multiple Cart Modules
« Reply #1 on: September 12, 2015, 11:09:43 am »
Which vm version? As far as I know this is fixed in latest version.

trevorbicewebdesign

  • Beginner
  • *
  • Posts: 16
    • Trevor Bice Webdesign
Re: Multiple Cart Modules
« Reply #2 on: September 12, 2015, 18:43:48 pm »
Was running the latest virtuemart 3x? Version looks like 3.0.9?
Never underestimate the power of stupid people in large groups.
http://webdesign.trevorbice.com/

trevorbicewebdesign

  • Beginner
  • *
  • Posts: 16
    • Trevor Bice Webdesign
Re: Multiple Cart Modules
« Reply #3 on: September 12, 2015, 18:54:45 pm »
If you check out my Git, you can look and see if there are any identifiers...maybe I somehow had the wrong version of the cart module?
Never underestimate the power of stupid people in large groups.
http://webdesign.trevorbice.com/

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7590
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Multiple Cart Modules
« Reply #4 on: September 12, 2015, 20:14:32 pm »
On VM3.0.10 there is still the problem of the hidden div being left behind ( the x's) - see screen

On yours Trevor I couldn't get it to install properly with the xml you used .. no parameters
also the code looks like it's from VM3.0.9.. there's been a few changes since in the 3.0.9.x series

Rejigged it a bit (used the latest 3.0.10 xml and renamed it etc) - attached

Works well except when the product list is shown, it isn't shown after the ajax refresh

see http://test.gjcwebdesign.com/joomla336/en/
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

trevorbicewebdesign

  • Beginner
  • *
  • Posts: 16
    • Trevor Bice Webdesign
Re: Multiple Cart Modules
« Reply #5 on: September 12, 2015, 21:16:16 pm »
Nice, thanks for cleaning that up! It seems to be working on my install @ http://makuacoffee.com/jupgrade/. I am checking to see if there are any differences that might account for it working here, but not on your test environment!
Never underestimate the power of stupid people in large groups.
http://webdesign.trevorbice.com/

trevorbicewebdesign

  • Beginner
  • *
  • Posts: 16
    • Trevor Bice Webdesign
Re: Multiple Cart Modules
« Reply #6 on: September 12, 2015, 21:24:08 pm »
So after I checked the files you adjusted, I looked and saw that I had changed the default.php template file. I've used your re-jiggered files on my Git, and I just adjusted the template. Can you re-install and see if that corrected the issue on your test environment?
Never underestimate the power of stupid people in large groups.
http://webdesign.trevorbice.com/

trevorbicewebdesign

  • Beginner
  • *
  • Posts: 16
    • Trevor Bice Webdesign
Never underestimate the power of stupid people in large groups.
http://webdesign.trevorbice.com/

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7590
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Multiple Cart Modules
« Reply #8 on: September 13, 2015, 11:59:16 am »
:)

working perfectly -- product list also refreshing and staying open!

Well done.. 
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multiple Cart Modules
« Reply #9 on: September 15, 2015, 20:48:02 pm »
thank you, is committed. Do you need that for a multivendor, multicart?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2257
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Multiple Cart Modules
« Reply #10 on: October 14, 2015, 22:15:27 pm »
Why you use ID ?
I think the first problem is to use ID:
Code: [Select]
<div id="hiddencontainer" style=" display: none; "> ....in 2 cart module or more is not javascript and html valid.
I don't understand why GJC Web Design and max validate this change ?

Another problem is you use jquery live.
check the jQuery doc http://api.jquery.com/live/
Quote
As of jQuery 1.7, the .live() method is deprecated.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9336
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Multiple Cart Modules
« Reply #11 on: October 15, 2015, 09:45:57 am »
Good point, Patrick. Overlooked that.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/