30 pointsStarting to get into this DEV thingI'm new here
micdech
Member
—
25th January 2012 (3 months ago)
Hi all.
I use the plugin marketpress, and would like to bring attention to a procedure of the plugin.
Once you have calculated the total, will pass to the function for calculating the fees, then the function of discount.
But I think this is wrong! For example, there are some products that have different taxes, such as food. And how do purchases that should have different taxes?
Another example: If I add the field categories to the discounters, such as the discount only applied to selected categories?
I say this because I have modified the plugin to select the categories which apply the discount. and tax different for different products (Something similar to shipping cost)
I use the plugin marketpress, and would like to bring attention to a procedure of the plugin.
Once you have calculated the total, will pass to the function for calculating the fees, then the function of discount.
But I think this is wrong! For example, there are some products that have different taxes, such as food. And how do purchases that should have different taxes?
Another example: If I add the field categories to the discounters, such as the discount only applied to selected categories?
I say this because I have modified the plugin to select the categories which apply the discount. and tax different for different products (Something similar to shipping cost)
9603 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Sales & Support Pro
—
26th January 2012 (3 months ago)
#
Hiya!
If you need to apply different tax to different products you will either need to add the tax to the price and inform visitors that prices include tax, or develop your own add-on to make the adjustments as it sounds like you have done.
Trying to deal with the different tax rules for many different countries is simply too much for MarketPress to do.
Maybe i can create the plugin, but if we don't change the procedure for the total, we have always the last mp_tax value for all product.
The same for the coupon: If we don't change the procedure adding a foreach, we can apply the coupon for all products (becasue it is applied to the total), not for the specified categories...
5570 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Support Kangaroo
—
3rd February 2012 (3 months ago)
#
Greetings micdech :-)
you are absolutely correct and we fully agree that our current plugin is not designed for multiple different taxation schedules to include the coupons for a single shopping cart instance.
If exist a meta_product[mp_tax][0] then apply this tax...otherwise apply the normal tax
The procedure is like a extra shipping cost you do...
The same is possible, for coupon code: Get all product
For each (product) if exist a coupon: if the product in array of categories, then apply the coupon to the price of the single product, otherwise apply normal price
5570 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Support Kangaroo
—
4th February 2012 (3 months ago)
#
Greetings Michele :-)
Thank you for this coding addition.
I believe in a separate post you made - you had included this code and I had not only sent it to the Feature Request but pinged the Developer of this plugin to take a look at it.
Please let me know if I am mistaken and this is different code then you had earlier you have submitted.
This are two different request and portion of code for two different Issues/details...
One to display the excerpt.
One to change the procedure to calculate the totals.
Are two different request, the first one is really simple.
The second one is for evaluate the procedure for the totals, so develop a plugin results more simple.
For example, i've posted a screenshot to demonstrate that i've just included a categories filter for coupon. The problem is that, actually, the coupon is applied to all products of user cart.
But what about if i want apply a coupon only for certain categories?
If we integrates a for each procedure, we can have more control about!
7023 pointsLike some sort of WPMU DEV GodMindblowingly helpful memberLifetime member
Lead Developer
—
6th February 2012 (3 months ago)
#
Thanks for your suggestions Michelle. I'll look at adding custom tax rates per product in a future version. For now though you'll have to do a custom plugin and filter the tax calculation.
Responses (9)
Sales & Support Pro — 26th January 2012 (3 months ago) #
Hiya!
If you need to apply different tax to different products you will either need to add the tax to the price and inform visitors that prices include tax, or develop your own add-on to make the adjustments as it sounds like you have done.
Trying to deal with the different tax rules for many different countries is simply too much for MarketPress to do.
Thanks,
Phil
Member — 3rd February 2012 (3 months ago) #
Hi phil,
thanks for your answer.
Maybe i can create the plugin, but if we don't change the procedure for the total, we have always the last mp_tax value for all product.
The same for the coupon: If we don't change the procedure adding a foreach, we can apply the coupon for all products (becasue it is applied to the total), not for the specified categories...
Don't you think so?
Best regards!
Michele
Support Kangaroo — 3rd February 2012 (3 months ago) #
Greetings micdech :-)
you are absolutely correct and we fully agree that our current plugin is not designed for multiple different taxation schedules to include the coupons for a single shopping cart instance.
Joe :-)
Member — 4th February 2012 (3 months ago) #
Hi all!
Perfect! this, imho, is really simple to do.
In order to accept this others values we can create a simple foreach cicle.
I do it:
foreach ($cart as $product_id => $variations) {
foreach ($variations as $variation => $data) {
$meta_product = get_post_custom($product_id);
print_r($data); print_r($meta_product); echo "
";
if($meta_product['mp_tax'][0]){
//$settings['tax']['tax_shipping'] = $meta_product['mp_tax'][0];
$tax = round($data['price'] * $meta_product['mp_tax'][0], 2);
$totals[] = $tax + $data['price'];
}
If exist a meta_product[mp_tax][0] then apply this tax...otherwise apply the normal tax
The procedure is like a extra shipping cost you do...
The same is possible, for coupon code: Get all product
For each (product) if exist a coupon: if the product in array of categories, then apply the coupon to the price of the single product, otherwise apply normal price
I hope that he was clear :)
Regards!
Michele
Support Kangaroo — 4th February 2012 (3 months ago) #
Greetings Michele :-)
Thank you for this coding addition.
I believe in a separate post you made - you had included this code and I had not only sent it to the Feature Request but pinged the Developer of this plugin to take a look at it.
Please let me know if I am mistaken and this is different code then you had earlier you have submitted.
Joe :-)
Member — 4th February 2012 (3 months ago) #
Hi aecnu,
This are two different request and portion of code for two different Issues/details...
One to display the excerpt.
One to change the procedure to calculate the totals.
Are two different request, the first one is really simple.
The second one is for evaluate the procedure for the totals, so develop a plugin results more simple.
For example, i've posted a screenshot to demonstrate that i've just included a categories filter for coupon. The problem is that, actually, the coupon is applied to all products of user cart.
But what about if i want apply a coupon only for certain categories?
If we integrates a for each procedure, we can have more control about!
Best regards
Michele
Lead Developer — 6th February 2012 (3 months ago) #
Thanks for your suggestions Michelle. I'll look at adding custom tax rates per product in a future version. For now though you'll have to do a custom plugin and filter the tax calculation.
Member — 6th February 2012 (3 months ago) #
Hi Aaron!
i've just write some of the necessary line of code to include this future in the core. :)
The last thing is to calculate it before the total.
I can send you my changes and include it on the next version of mp soon as possible! =)
Let me know
Member — 6th February 2012 (3 months ago) #
Also this last part i've write, but cannot include in the file i use to run my site... :)
Become a member