Hi all,
I have develop an system plugin, and on the cart page, i have options, how to i can get cart session and change the Total price when i choose options.
Thank so much !
check the textinputplugin.
Quote from: Milbo on March 27, 2015, 09:53:45 AM
check the textinputplugin.
Hi Milbo,
I did checked but that's vmcustom plugin so i can't get anything.
Also i have tried with code :
if (!class_exists( 'VmConfig' )) require(JPATH_ADMINISTRATOR . '/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
if(!class_exists('VirtueMartCart')) require(JPATH_VM_SITE.DS.'helpers'.DS.'cart.php');
$cart = VirtueMartCart::getCart();
$cart->cartPrices['billTotal'] = $cart->cartPrices['billTotal']+10;
But it's still nothing change.
I think i did wrong. Do you have solution?
Thank you so much !
are you using system plugin?
or virtuemart custom plugin?
what version are you using?
Quote from: PRO on March 27, 2015, 14:46:52 PM
are you using system plugin?
or virtuemart custom plugin?
what version are you using?
Hi PRO,
Yes i used system plugin, and VM 3.0.6 version, joomla 3.4
Thank you so much !
why not a virtuemart custom plugin?
WHAT IS IT SUPPOSED TO DO?
Quote from: PRO on March 27, 2015, 18:40:17 PM
why not a virtuemart custom plugin?
WHAT IS IT SUPPOSED TO DO?
Hi PRO,
Because i want choose options on the cart page, not productdetail page. Please help me.
@Milbo
Thank you so much !
Hello @Milbo, Hello @PRO
How are you?
Hello
I have tried :
$data = $this->cart->prepareAjaxData(FALSE);
$prices = $this->getCartPrices();
$prices["billTotal"] += 10;
$this->cart->setCartIntoSession();
But still can't save new price :(
Can someone help me?
Thank a lot !
baoquocmt159,
describe what your plugin does.
what is the option for?
Quote from: PRO on March 30, 2015, 11:46:50 AM
baoquocmt159,
describe what your plugin does.
what is the option for?
Hi PRO,
I have a <select .. option>, when i select option, i use jQuery ajax to php file, in this php file, i want $prices["billTotal"] add 10 (for example), and i did used code :
// load VM config, VM helper cart here.
$data = $this->cart->prepareAjaxData(FALSE);
$prices = $this->getCartPrices();
$prices["billTotal"] += 10;
$this->cart->setCartIntoSession();
But it's still notchange :(
Thank a lot !
I am not sure how to help with a system plugin.
does this have to do with shipping etc?
Because i know this could easily be done with a shipping plugin
baoquocmt159 your way would be very unsecure.What you try does not work in VM. VM recognises it as illegal data manipulation and sets the correct values
Hi Milbo, PRO
I did solved by myself.
Thanks
Hi, I know this is a dead thread, however I am looking at the same problems myself and was wondering if you could let me know how you solved the issue, or perhaps let me have a copy of your plugin :)
Dean
Skype: Datalynk
Quote from: baoquocmt159 on March 28, 2015, 04:25:28 AM
Because i want choose options on the cart page, not productdetail page. Please help me.
You still need a vm plugin and you still must use the trigger used in the customplugins to change the price. By security reasons it does NOT work to change the price in the session, it would be corrected by the system. You MUST use a correct plugin and it is nonsens to write a joomla plugin, if we have already a pattern for it.
Quote from: Datalynk on September 24, 2015, 00:05:09 AM
Hi, I know this is a dead thread, however I am looking at the same problems myself and was wondering if you could let me know how you solved the issue, or perhaps let me have a copy of your plugin :)
Dean
Skype: Datalynk
yeh that would be indeed interesting.
I understand that a properly constructed plugin IS the way forward, however I would like to know which of the available types of VM plugin is most suited to this task (i.e. vmcalculation or vmcustomfield etc...).
vmcustom
check the textinput plugin and the function plgVmPrepareCartProduct
Quote from: Datalynk on September 24, 2015, 15:49:17 PM
I understand that a properly constructed plugin IS the way forward, however I would like to know which of the available types of VM plugin is most suited to this task (i.e. vmcalculation or vmcustomfield etc...).
vm custom field
Thank you Milbo, I have found what I need in the textinput plugin to override product price...