Posted by DanClarkePro on February 10, 2011 at 9:45am
2 followers
| Project: | Ubercart Ajax Attribute Calculations |
| Version: | 6.x-2.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | Usability |
Issue Summary
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.
Comments
#1
Attached patch file, wasn't sure how to do it before.
#2
Before:
http://cl.ly/4VFR
After:
http://cl.ly/4VEM
#3
I 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".
#4
Attached updated diff file to include title changes from "Attribute" to "Attribute + Price" as seen here: http://cl.ly/4VpQ