
Originally Posted by
karimm
Hello Kellan,
Were does this peace of code have to go, were do i put it ?
regards,
I have changed my includes/modules/attributes.php file. Here is the code changes I have made. If you search the if line you should be able to locate it in your code.
This is around line 119 in my code
Code:
if($products_options->fields['quantity'])
{
$products_text_to_use = $products_options->fields['products_options_values_name'] . ' ' . TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' ' . TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ';
}
This is around line 208 in my code
Code:
if ($products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_TEXT and $products_options_names->fields['products_options_type'] != PRODUCTS_OPTIONS_TYPE_FILE) {
// $products_options_details = $products_options->fields['products_options_values_name'];
// gbm - replaced original line above to display attribute stock amount beside attribute
$products_options_details = $products_options->fields['products_options_values_name'] . ' ' . TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ';
}
This is around line 218 in my code
Code:
if ($products_options_names->fields['products_options_images_style'] >= 3) {
$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
// $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
// gbm - replaced original line above to display attribute stock amount beside attribute
$products_options_details_noname = ' '. TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '<br />' . $products_options_display_weight : '');
} else {
$products_options_details .= $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
// $products_options_details_noname = $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
// gbm - replaced original line above to display attribute stock amount beside attribute
$products_options_details_noname = ' ' . TEXT_ATTRIBUTES_PIECES_OPEN . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . TEXT_ATTRIBUTES_PIECES_CLOSE . ' ' . $products_options_display_price . ($products_options->fields['products_attributes_weight'] != 0 ? '' . $products_options_display_weight : '');
}
}
I also have changed the language file for product_info.php to define the following
Code:
define('TEXT_ATTRIBUTES_PIECES','Available');
define('TEXT_ATTRIBUTES_PIECES_OPEN','(');
define('TEXT_ATTRIBUTES_PIECES_CLOSE',')');
This changes 'pieces' to 'Available'.
This also will allow me to change the grouping symbols in one place for all of what were hard coded '[' before. In case the customer doesn't like the brackets.
Hope this helps.
Bookmarks