I apologize if this is not the correct thread, but it's the closest I can find searching through the forum...
I am using 1.5.8a w/ Classic Responsive template and SBA plugin. All is working great. I just have a "tweek" I would like to make and thought I had it resolved, but did not. My goal is to allow the "display only" attribute prices appear on the product listing when the "base price" is also selected. It seems the out of box option does not currently allow this functionality.
I do not write code and it is somewhat foreign to me buy I have managed to get by thanks to the file structure of zencart that allows simple changes. I found the code below in the includes/functions directory under the functions_prices.php file and changed it as displayed. With the change Display only attributes are now displaying prices on the product listing pages. That's great. However, I also need the NON-display only attributes to display prices on the product listing pages. Why? The display only attributes are not inventory items, they are displayed for group prices display only purposes not for tracking inventory, but when I turn off the display only option, the drop down displays the display only attributes as "out of stock" which can be confusing to users, I would prefer it not say anything as it does w/ the display only option. As for the non display only options, those are single items that are tracked for inventory and therefore not display only, but I would like the prices displayed on the product listing as well.
I am aware that I can choose to place the prices w/ the product and not select the "Product Priced by Attributes" to have them display. But I would prefer to update all prices w/ EP on the attributes spreadsheet instead of having to go to the Full and Attributes pages for price updates. SBA works perfect for my use and if I can simply have the display only AND non display only attributes display on the product listing it would be perfect for my use.
PHP Code:
$sql = "SELECT options_id, price_prefix, options_values_price,
attributes_display_only, attributes_price_base_included,
CAST(CONCAT(price_prefix, options_values_price) AS decimal(15,4)) AS value
FROM " . TABLE_PRODUCTS_ATTRIBUTES . "
WHERE products_id = " . (int)$product_id . "
AND attributes_display_only != 1
AND attributes_price_base_included=1
ORDER BY options_id, value";
$results = $db->Execute($sql);
$the_options_id = 'x';
$the_base_price = 0;
and I changed it to
PHP Code:
$sql = "SELECT options_id, price_prefix, options_values_price,
attributes_display_only, attributes_price_base_included,
CAST(CONCAT(price_prefix, options_values_price) AS decimal(15,4)) AS value
FROM " . TABLE_PRODUCTS_ATTRIBUTES . "
WHERE products_id = " . (int)$product_id . "
AND attributes_display_only != 0
AND attributes_price_base_included=1
ORDER BY options_id, value";
$results = $db->Execute($sql);
$the_options_id = 'x';
$the_base_price = 0;
Sorry for the long message and I hope this makes sense, if not, I am happy to clarify. Thank you.
Bookmarks