This is how I solved it. Any simpler or cleaner solutions would be appreciated by the community.
Read carfully and you'll get the understanding of how this works, (see end for more)
in admin/attributes_controller.php
find
Code:
$attributes_price_letters = zen_db_prepare_input($_POST['attributes_price_letters']);
in 2 places and replace with
Code:
$att_price_let=$_POST['attributes_price_letters'];
$att_qty_price=$_POST['att_qty_price'];
if (isset($att_qty_price)){$att_price_let=10000 + $att_qty_price;}
$attributes_price_letters = zen_db_prepare_input($att_price_let);
in 2 places find
Code:
<td align="center" class="smallText" nowrap="nowrap"> <?php echo TABLE_HEADING_ATTRIBUTES_PRICE_LETTERS . ' ' . TABLE_HEADING_ATTRIBUTES_PRICE_LETTERS_FREE; ?><br /> <input type="text" name="attributes_price_letters" value="<?php echo $attributes_values->fields['attributes_price_letters']; ?>" size="6"> <input type="text" name="attributes_price_letters_free" value="<?php echo $attributes_values->fields['attributes_price_letters_free']; ?>" size="6"> </td>
and put
Code:
<!-- Attribute Qty Price will actually mock up a Text attribute. -->
<td align="center" class="attributeBoxContent" nowrap="nowrap"> <?php echo 'Attribute Qty Price <br />'; ?><input type="text" name="att_qty_price" size="6"></td>
under it.
----------
in *yourcart*/includes/functions/functions_prices.php
find
Code:
// calculate letters price
function zen_get_letters_count_price($string, $free=0, $price) {
$letters_price = zen_get_letters_count($string, $free) * $price;
if ($letters_price <= 0) {
return 0;
} else {
return $letters_price;
}
}
and replace with
Code:
// calculate letters price or att qty price
function zen_get_letters_count_price($string, $free=0, $price) {
if ($price>10000)
{
$attqtyprice='flagged';
$price=$price-10000;
}
$count_letters=zen_get_letters_count($string, $free);
if ($attqtyprice=='flagged'){$count_letters=$string;} // allows a text box to be used to select a certain
// number of an attribute like 2 extra widgets.
// a bit of a hack job, but it should work.
$letters_price = $count_letters * $price;
if ($letters_price <= 0) {
return 0;
} else {
return $letters_price;
}
}
and in *yourcart*/includes/modules/pages/product_info/main_template_vars_attributes.php
find
Code:
//$tmp_html .= TEXT_PER_LETTER . $currencies->display_price($products_options->fields['attributes_price_letters'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ($products_options->fields['attributes_price_letters_free'] !=0 ? TEXT_LETTERS_FREE . $products_options->fields['attributes_price_letters_free'] : '');
and replace with
Code:
//for display only
$txtprltr=TEXT_PER_LETTER;
$displayperlettercost=$products_options->fields['attributes_price_letters'];
if ($displayperlettercost > 10000) {$displayperlettercost=$displayperlettercost-10000;
$txtprltr= "Price Each:";
}
$tmp_html .= "$txtprltr ". $currencies->display_price($displayperlettercost, zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ($products_options->fields['attributes_price_letters_free'] !=0 ? TEXT_LETTERS_FREE . $products_options->fields['attributes_price_letters_free'] : '');
When adding an attribute that uses this script, create it as a text attribute. When applying the attribute, look next to the per letter and per word prices and you'll find the new box. when you edit an existing att qty priced item, you will find a $10000.00+ price in the per-letter box. Just delete it and edit the Attribut Per Quantity Price as needed. If for some reason, there was a need to have an actual text attribute with a per letter price greater than $10000.00, one would have to put in a price $10000.00 greater than the actual price.