Author Topic: Preconfigured carts  (Read 675 times)

tisba

  • Beginner
  • *
  • Posts: 2
  • A beginner
Preconfigured carts
« on: January 14, 2017, 10:41:49 am »
Dear all,
is it possible to create some preconfigured carts containing different products and quantities?
E.g, I would like to create "cart 1" containing 2 products A and 3 products B. Than, I would like to create a "cart 2" containing 1 products B and 4 products C.
This way a user can select "cart 1" or "cart 2", modify it (if needed) or create hits own cart

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26752
  • Always on vacation
    • Jenkin Hill Internet
Re: Preconfigured carts
« Reply #1 on: January 14, 2017, 12:10:21 pm »
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.14.9808 on Joomla 3.8.6 PHP 7.0.29

Testing VM3.2.14.9808 on J3.8.6

tisba

  • Beginner
  • *
  • Posts: 2
  • A beginner
Re: Preconfigured carts
« Reply #2 on: January 14, 2017, 21:13:49 pm »
Sorry  :)
I'm using VM 3.0.18 on Joomla 3.6.5 with PHP 5.5.38

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 2900
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Preconfigured carts
« Reply #3 on: January 14, 2017, 23:13:21 pm »
You can use a link, having all data on it.
In my case for 1 product it's MYSITE/fr/cart?task=add&quantity%5B%5D=15&virtuemart_product_id%5B%5D=22
For multiple products
MYSITE/fr/cart?task=add&quantity%5B%5D=15&virtuemart_product_id%5B%5D=22&quantity%5B%5D=2&virtuemart_product_id%5B%5D=45 ...
SEF is active and i use fr language tag for french.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9535
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Preconfigured carts
« Reply #4 on: January 16, 2017, 18:11:45 pm »
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

emedina

  • Beginner
  • *
  • Posts: 31
Re: Preconfigured carts
« Reply #5 on: January 24, 2017, 13:58:41 pm »
I think you can do this with Javascript in your template:

for example:

<?php if ($myvar == 'myresult'){   //check condition A or B
?>  //close php
<script>
jQuery(document).ready(function($){  //or other trigger we want to use
jQuery.ajax({
  method: 'POST',
  url: Virtuemart.vmSiteurl + "index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json"+Virtuemart.vmLang+window.Itemid,  //be sure this script is under virtuemart javascript is defined
  cache: 'false',
  data:{
     ids: [1991]   //an array with our ids
  },
  success: function(msg){
    //TODO handle success function, maybe alert or sweetalert
  },
  error: function(){
    //TODO handle error
}

});
</script>
<?php
}
else
{
//another javascript for other products
?>
<script>
jQuery(document).ready(function($){  //or other trigger we want to use
jQuery.ajax({
  method: 'POST',
  url: Virtuemart.vmSiteurl + "index.php?option=com_virtuemart&nosef=1&view=cart&task=addJS&format=json"+Virtuemart.vmLang+window.Itemid,  //be sure this script is under virtuemart javascript is defined
  cache: 'false',
  data:{
     ids: [1995,1987]   //an array with our ids
  },
  success: function(msg){
    //TODO handle success function, maybe alert or sweetalert
  },
  error: function(){
    //TODO handle error
}

});
</script>
<?php
};
?>

Good luck

venneri

  • Beginner
  • *
  • Posts: 1
  • A beginner
Re: Preconfigured carts
« Reply #6 on: January 12, 2018, 17:43:25 pm »
Hello mr. Milbo.
I just buy your extension  "vm-isx-cart-saver".
I have many problems.
Con you help me?
I wait yours.
Thanks.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 26752
  • Always on vacation
    • Jenkin Hill Internet
Re: Preconfigured carts
« Reply #7 on: January 12, 2018, 23:31:23 pm »
@verreri support for that plugin is by ticket - go to http://extensions.virtuemart.net/ticket
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.14.9808 on Joomla 3.8.6 PHP 7.0.29

Testing VM3.2.14.9808 on J3.8.6