[Plugin: WP e-commerce] Handling fee for only some categories?
-
I’ve received a request from the client that’s got me flummoxed, though. There are 3 basic groups of things for sale on the site:
- Season subscriptions
- Classes
- Donations
The client would like for a $5 handling fee to be added if season subscriptions is ordered. The $5 fee is a one-time charge. Like, if they order 5 subscriptions, it’s $5.
Looking over the forums, I saw how to adjust cart.class.php to add a flat fee to the total, and use the following code in the calculate_total_shipping function, just to kind of test the idea:
$total = $this->calculate_base_shipping() + 5.00;
That does a lovely job of adding a flat $5 to every transaction. But, that’s obviously not going to work for the purpose at hand, since that also charges $5 handling for donations and classes.
Basically, I’d love if someone could point me in the right direction on this.
I feel like there’s a way to, in the calculate_total_shipping function, have some sort of thing for product category? Like anif($category == 1) { $total = $this->calculate_base_shipping() + 5.00; } else { $total = $this->calculate_base_shipping();
But I have no idea what the category syntax would be, nor how to track down the id/string/whatever assigned to the product category.
Am I on the right track? Is there a better way to go about this?
- The topic ‘[Plugin: WP e-commerce] Handling fee for only some categories?’ is closed to new replies.