woocommerce-dynamic-pricing | Synced | Content Management System library
kandi X-RAY | woocommerce-dynamic-pricing Summary
kandi X-RAY | woocommerce-dynamic-pricing Summary
WooCommerce Dynamic Pricing, Git-ified. Synced manual! This repository is just a mirror of the WooCommerce Dynamic Pricing plugin. Please do not send pull requests.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Generates Javascript code for the metabox
- Get the discount for a product .
- Admin page .
- On get_price callback .
- Reset the cart counters
- Returns true if the user is valid for the given user .
- Get the adjusted price for an order item .
- Calculate the adjusted price for a cart item .
- Adjust cart items .
- Create the variation selector .
woocommerce-dynamic-pricing Key Features
woocommerce-dynamic-pricing Examples and Code Snippets
Community Discussions
Trending Discussions on woocommerce-dynamic-pricing
QUESTION
The following code is working to exclude products from the Dynamic Pricing discount if they are on sale. Now I would like to extend this function to also include specific products and categories (not necessarily in the same function).
Is it sufficient with the ID to add to the if-statement a "or product id = xx" ?
Here's the code so far:
...ANSWER
Answered 2018-Aug-10 at 19:05You can try the following that will handle specific product ids and product categories to be defined in the code (Untested):
QUESTION
I am trying to change the cart content based on the quantity of a product in the cart. I only have 5 products in the shop:
- Product_1 => 1 panel,
- Product_2 => 12 panels,
- Product_3 => 18 panels,
- Product_4 => 30 panels,
- Product_5 => 60 panels,
They are configured as different products, so no bundles, kits or anything. More than one panel products are obviously cheaper than adding a number of single panels separately.
Then I have also a custom product that calculates the number of panels needed based on floor measures given by the customer and then adds to cart the necessary quantity of single panels.
I Would like to change dynamically the content of the cart when it's reviewed.
So for example, if the floor configurator calculate 54 single panels and added them to the cart, I would like to change the cart item to:
- 1 Product_4 (30 panels)
- 1 Product_2 (12 panels)
- 2 Product_1 (1 panel)
- and print a message stating the change.
I've checked different solutions but none of them offer this kind of feature:
- How to bundle products with WooCommerce
- WooCommerce Product Bundles - Bulk Discounts
- WooCommerce Dynamic Pricing & Discounts
So, based on this answer thread, I think I need to use hook woocommerce_before_calculate_totals
and implement the logic, but need some help since I am a wordpress dev noob.
Note that the add to cart button is called with Ajax in the floor configurator with:
...ANSWER
Answered 2018-May-22 at 18:59The code bellow should do the trick, It will replace the custom product (quantity) by your other products. You will have to set your custom product ID, your 5 normal product IDs and your custom text notice.
The code:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install woocommerce-dynamic-pricing
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page