Fix function that is used to add variation products to the cart
- or -
Post a project like this£55(approx. $69)
- Posted:
- Proposals: 14
- Remote
- #3415638
- Expired
⭐ ⭐ ⭐ ⭐ ⭐ Top Rated in Plymouth UK, 17+ Years Professional Experience, A+ Communications
Metuchen
WORDPRESS ( WOOCOMMERCE AND PLUGIN) AND CMS EXPERT - QUICKEST DELIVERY GURANTEED 12 + YEARS
Mohali
WordPress/WooCommerce, Shopify | iPhone, Android |SEO, SMO, PPC (Google Adwords)
New Delhi
Shopify Wizard | Shopify Plus | CRO Expert| Ecommerce Strategist | Wordpress Developer
Nagpur
WordPress Expert✮Shopify Expert✮Graphic Designer✮AutoCAD 2D & 3D✮CV Writer & Designer✮Fullstack developer
Rawalpindi
Professional Digital Marketer | Web Development | IOS and Android Developer | WordPress | React Native | Video Editor | Graphic Designing
Islamabad
2742635991436392068151828366691505883177450919859862062946301554936365735455394
Description
Experience Level: Entry
This is for Woocommerce
We currently have a custom function (addVariationAJAX()) which is used for + and - buttons alongside each variation on the product page, the + will add this variation to the cart and the - will remove it.
The issue arises when there is already a bundle product within the basket, and you attempt to add an additional single item to the basket that already exists within the bundle, instead of adding it as a single item (not part of the bundle) it seems to remove that item from within the bundle and increases the quantity by 1. This obviously means the bundle no longer contains the minimum amount of products and checkout cannot be completed.
We will need a modification to the function so when it checks if the product is already within the basket, it excludes those if they are within a bundle. For a bundle product it should only check the main bundle product, and not the individual products within that bundle.
EXAMPLE BELOW
If you have a bundle item (Max Bundle) within the basket, this bundle will contain 4 products;
- Caramel Shortbread
- Chocolate Slice
- Orange Brownie
- Coconut Bar
The issue is when you attempt to add an additional product (e.g. Chocolate Slice) to the basket that is already within the bundle. Rather than the basket containing:
- Max Bundle
.Caramel Shortbread x 1
.Chocolate Slice x 1
.Organge Brownie x 1
.Coconut Bar x1
- Chocolate Slice x 1
It ends up looking like:
- Max Bundle
.Caramel Shortbread x 1
.Organge Brownie x 1
.Coconut Bar x1
- Chocolate Slice x 2
We currently have a custom function (addVariationAJAX()) which is used for + and - buttons alongside each variation on the product page, the + will add this variation to the cart and the - will remove it.
The issue arises when there is already a bundle product within the basket, and you attempt to add an additional single item to the basket that already exists within the bundle, instead of adding it as a single item (not part of the bundle) it seems to remove that item from within the bundle and increases the quantity by 1. This obviously means the bundle no longer contains the minimum amount of products and checkout cannot be completed.
We will need a modification to the function so when it checks if the product is already within the basket, it excludes those if they are within a bundle. For a bundle product it should only check the main bundle product, and not the individual products within that bundle.
EXAMPLE BELOW
If you have a bundle item (Max Bundle) within the basket, this bundle will contain 4 products;
- Caramel Shortbread
- Chocolate Slice
- Orange Brownie
- Coconut Bar
The issue is when you attempt to add an additional product (e.g. Chocolate Slice) to the basket that is already within the bundle. Rather than the basket containing:
- Max Bundle
.Caramel Shortbread x 1
.Chocolate Slice x 1
.Organge Brownie x 1
.Coconut Bar x1
- Chocolate Slice x 1
It ends up looking like:
- Max Bundle
.Caramel Shortbread x 1
.Organge Brownie x 1
.Coconut Bar x1
- Chocolate Slice x 2
Jack B.
99% (184)Projects Completed
266
Freelancers worked with
180
Projects awarded
57%
Last project
29 Apr 2024
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies