A client of ours would like to be able to see the full price in the drop down, not just the +/- change on the price, I have amended the module for this.
From line 127 to 142 I have amended accordingly:
else {
$price = $option->price;
//Removed below line as this updates the prices dynamically,
//however this is not needed as prices already set.
// - $product->attributes[$aid]->options[$selected_oid]->price;
}
// Rebuild option text
$oid_text = '';
if ($price != 0) {
$oid_text = ', ';
if ($price > 0) {
$oid_text .= uc_price($price+$form['node']['#value']->cost, $context); //Will show price as (Val), $(cost+attribute)
}
else {
$oid_text .= uc_price($price+$form['node']['#value']->cost, $context); //Will show price as (Val), $(cost-attribute)
}
}
else {
$oid_text = ', ';
$oid_text .= uc_price($price+$form['node']['#value']->cost, $context); //Will show price as (Val), $(cost)
}
$options[$option->oid] = $option->name . $oid_text;This does remove the initial functionality of this module to show the +/- changes, however is there a way to have this option built in, so that in the admin page I can say "Show full price" or "Show changed price"
Hope this makes sense,
thanks,
-Dan.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | uc_aac-1057226.patch | 2.85 KB | overbythere |
| #1 | uc_aac-1057226.patch | 2.18 KB | overbythere |
Comments
Comment #1
overbythere commentedAttached patch file, wasn't sure how to do it before.
Comment #2
overbythere commentedBefore:
http://cl.ly/4VFR
After:
http://cl.ly/4VEM
Comment #3
yoroy commentedI would agree that this way of putting it is the more useful way to present it. Consider rewording the label from "Size" to "Size and price".
Comment #4
overbythere commentedAttached updated diff file to include title changes from "Attribute" to "Attribute + Price" as seen here: http://cl.ly/4VpQ