- Posts: 42
- Thank you received: 3
onBeforeCartSave
4 years 2 months ago #343398
by JF
onBeforeCartSave was created by JF
-- url of the page with the problem -- :
eduquay.satumalaysiahosting.com/bundle-p...8-buku-buku-lembaran
I'm trying to save all bundled products with one click hence I developed a plugin implementing onBeforeCartSave.
But I'm confused about the function body for example, what should I write in the plug-in function.
function onBeforeCartSave(&$element,&$do)
{
// Code
}
I have already gone through the documentation but still have no idea. I hope can get some examples here.
I'm trying to save all bundled products with one click hence I developed a plugin implementing onBeforeCartSave.
But I'm confused about the function body for example, what should I write in the plug-in function.
function onBeforeCartSave(&$element,&$do)
{
// Code
}
I have already gone through the documentation but still have no idea. I hope can get some examples here.
Please Log in or Create an account to join the conversation.
4 years 2 months ago #343400
by nicolas
Replied by nicolas on topic onBeforeCartSave
Hi,
What do you mean by "save all bundled products with one click" ?
The onBeforeCartSave event is triggered when the cart of the user is modified (when a product is added, removed, updated, etc).
Are you saying that when a product is added to the cart, you want to also add to it the bundled products of that product to the cart ?
You'll find the products in $element->products
So you'll first want to loop on the products in there, and load the bundled products of these products with a MySQL query on the hikashop_product_related table. You'll then want to add them to $element->products.
What do you mean by "save all bundled products with one click" ?
The onBeforeCartSave event is triggered when the cart of the user is modified (when a product is added, removed, updated, etc).
Are you saying that when a product is added to the cart, you want to also add to it the bundled products of that product to the cart ?
You'll find the products in $element->products
So you'll first want to loop on the products in there, and load the bundled products of these products with a MySQL query on the hikashop_product_related table. You'll then want to add them to $element->products.
Please Log in or Create an account to join the conversation.
4 years 2 months ago #343426
by JF
Replied by JF on topic onBeforeCartSave
Hi,
URL: eduquay.satumalaysiahosting.com/bundle-p...8-buku-buku-lembaran
I have created an 'Add All' button to add all the listing products to the cart, the method I'm using now is triggered the 'href' by JQuery, but it seems too heavy for the server.
So I'm now trying to develop a plugin to perform this action.
URL: eduquay.satumalaysiahosting.com/bundle-p...8-buku-buku-lembaran
I have created an 'Add All' button to add all the listing products to the cart, the method I'm using now is triggered the 'href' by JQuery, but it seems too heavy for the server.
So I'm now trying to develop a plugin to perform this action.
The following user(s) said Thank You: Philip
Please Log in or Create an account to join the conversation.
4 years 2 months ago #343432
by Philip
Replied by Philip on topic onBeforeCartSave
Hello,
This message just to inform you that we are in reduced numbers (holiday period), and that consequently our follow-up will be slower than usual.
Hope this is not a problem for you
Regards
This message just to inform you that we are in reduced numbers (holiday period), and that consequently our follow-up will be slower than usual.
Hope this is not a problem for you
Regards
Please Log in or Create an account to join the conversation.
Time to create page: 0.206 seconds