WP Developer
Forum Replies Created
-
Hello @expande,
Unfortunately, I’m unsure why import does not run for all variations. I’ll do further testing, but for now, I’d recommend creating a separate CSV tiered pricing import, where you match variations by ID. This should work fine.
Sorry about the inconvenience.
So it always logs the same variation ID for all variations import?
Can you also clarify how you match the products in WP All Import?
Hello @syntaxerrorno,
Thanks for pointing this.
We will make the plugin start searching for a category starting from 2 or maybe even 1 character in the next update.
So, 170707 is a variable product id or variation id?
It looks like you used singular quotation marks instead of double quotes, as in the example I’ve provided.
$this->log( “Product ID: $post_id” ); // Double
$this->log( 'Product ID: $post_id' ); // SingularThe import log should now include the product ID associated with the imported data, allowing us to verify whether it uses the variable product ID or the variation IDs.
Sorry I mean path relative to the plugin folder.
So, the full path should be wp-content/plugin/tier-pricing-table/src/Integrations/Plugins/WPAllImport.php
Hello @expande,
Sorry for the late reply.
Unfortunately, I cannot reproduce this issue, and I am unsure why it works this way at this point.
Can you please try to add the following line of code to the WP All import file so we can track what product ID is used to import data?
$this->log( “Product ID: $post_id” );
<span style=”box-sizing: border-box; margin: 0px; padding: 0px;”>The file is located at?src/Integrations/Plugins/WPAllImport.php,?and th</span>e function “processImport” is on the?52?line.
Thank you.
Forum: Plugins
In reply to: [Tiered Pricing Table for WooCommerce] Use with custom Product TypeHello,
We haven’t heard from you in a while, so I’m going to mark this as resolved.
Feel free to start a new thread if you have any other questions.You can use “edit” context to not pass the property through hooks when you get it.
Here is the code that should work for you:
add_filter( 'tiered_pricing_table/price/pricing_rule', function ( \TierPricingTable\PricingRule $pricingRule, $productId ) {
if ( $pricingRule->isPercentage() ) {
return $pricingRule;
}
$product = wc_get_product( $productId );
if ( ! $product ) {
return $pricingRule;
}
$pricingRules = $pricingRule->getRules();
$salePrice = $product->get_sale_price('edit');
if ( $salePrice ) {
// filter prices that are less than sale price
$pricingRules = array_filter( $pricingRules, function ( $price ) use ( $salePrice ) {
return $price < $salePrice;
} );
$pricingRule->setRules( $pricingRules );
}
return $pricingRule;
}, 999, 2 );Hello @axos1192,
This is wholly expected behavior. We will not restrict tiers that are higher than regular/sale prices because some users actually increase their prices when the quantity goes up, so flat price tiers give you complete control over those cases.
As mentioned in that thread, you can use percentage-based tiers to calculate the prices based on the sale or regular price (this is controlled in the settings). You can also have a CSV import file to quickly update your flat price tiers when the sale price is present.
The plugin also provides the “tiered_pricing_table/price/pricing_rule” hook, which you can use to modify the pricing at runtime. See examples in the src/PriceManager.php file.
Hope this helps.
does all other data import fine?
Hello,
Thanks for clarifying.
Can you try selecting “choose what data to update” and making sure tiered pricing is selected?Then, you can switch back to “Update all data.”
I’ve checked the function that checks whether tiered pricing should be updated or not, and the “Tiered Pricing” parameter is checked at the very beginning, so it may help: https://i.ibb.co/gwQGsN7/image.png
Hello @expande,
Can you confirm that “Tiered Pricing” option is checked?