Krzysztof Pi?tkowski
Forum Replies Created
-
Some themes (maybe divi builder as well) uses product price in cart templates, but it should use cart item price. My plugin overrides cart item price, but not product price.
Forum: Plugins
In reply to: [Product Fields, Addons and Price Calculator for WooCommerce] Elementor@bomberone83 Hi, the plugin outputs content using woocommerce_before_add_to_cart_button hook. Page builders are not supported.
Hi @nyfoxyloxy
I can’t see my plugin under link. Can you send me theme files at support#wckalkulator.comhttps://github.com/piatkowski/wckalkulator/blob/master/src/ProductHelper.php
Line 100 and 111 should be wrapped in that additional WOOCS code
Try remove_action with woocommerce_before_add_to_cart_button.
remove_action('woocommerce_before_add_to_cart_button', array(\WCKalkulator\Woocommerce\Product::class, 'price_block'));
@david5555 should be a toolbar at top or the bottom of window.
@nyfoxyloxy @jakubsendal Add some icon to tag
<span class="dashicons dashicons-editor-help wck-field-tip">
. Hints are there, but icon is not visible because dashicons were disabled. I will note to remove dashicons and extract only used icons.I see now.
First of all in FieldsetProduct.php code should look like
$result = $parser->execute(); if (isset($result['value']) && $result['is_error'] === false) { if (class_exists('WOOCS')) { global $WOOCS; $result['value'] = $WOOCS->woocs_exchange_value(floatval($result['value'])); } $this->user_input['total_price'] = $result['value'] * $this->user_input["quantity"]; } return $result;
And then open ProductHelper.php and find every method which returns price (price, sale price, regular price) and apply woocs_exchange_value.
I note that to add in the future releases, because you will lost these changes on update.
@airplanetees Hi, this is not possible by default, but you should override view file: https://github.com/piatkowski/wckalkulator/blob/master/views/fields/cart.php
As you can see there is if($has_value), which should be removed if you need to show line items without values.
To do so, copy file from plugin’s directory from views/fields/cart.php to your-theme/wc-kalkulator/fields/cart.php and make changes (remove if($has_value) or set $has_value to always true).
I need more information to solve this issue. What is your fieldset configuration? Can you send me website url at support[at]wckalkulator.com ?
@samganti Hi, you are able to update global parameter value by php code and then use that global parameter in formula.
@hjfierce please check if form tag has enctype parameter to handle file upload. The ATC button should be inside that form tag
@antonio7ungolo this error occurs if POST request has not ‘_wck_product_id’ and ‘quantity’ fields or these fields equals to 0.
@dirimmedia Hi, to change price block you should remove actions https://github.com/piatkowski/wckalkulator/blob/master/src/FieldsetProduct.php#L923
For example in your functions.php:
remove_action('woocommerce_after_add_to_cart_button', array(\WCKalkulator\Woocommerce\Product::class, 'price_block'));
and then add action:
add_action('your_hook_before_short_description', array(\WCKalkulator\Woocommerce\Product::class, 'price_block'));
You need to add
do_action(your_hook_before_short_description')
by yourself, because woocommerce has only ‘woocommerce_before_add_to_cart_form’ and ‘woocommerce_single_product_summary’ which may not be what you want.