valquiria23 Posted July 7, 2017 Share Posted July 7, 2017 Dear @Omar_one It's getting better but it still does not go well. Please look the attachment Cheers Valqui Community Oscommerce fan You'll find the latest osC community version here. Link to comment Share on other sites More sharing options...
Omar_one Posted July 7, 2017 Author Share Posted July 7, 2017 @valquiria23 it is looking well on my browsers see the attachment Get the latest Responsive osCommerce CE (community edition) here . Link to comment Share on other sites More sharing options...
valquiria23 Posted July 7, 2017 Share Posted July 7, 2017 Dear @Omar_one Yes that seems You might have a Widescreen and I hace a Standard screen 4:3 ... Can that be the difference? BR Valqui Community Oscommerce fan You'll find the latest osC community version here. Link to comment Share on other sites More sharing options...
Omar_one Posted July 7, 2017 Author Share Posted July 7, 2017 @valquiria23 which categories? pm me the link Get the latest Responsive osCommerce CE (community edition) here . Link to comment Share on other sites More sharing options...
helenium7 Posted December 13, 2017 Share Posted December 13, 2017 On 21/06/2017 at 8:38 PM, Omar_one said: @Jeep_ice sometime ago @burt share some code on the forum to do this . I don't know the topic, but here the copied code: in /includes/functions/html_output.php Find: if ( isset($params['params']) ) { $button .= ' ' . $params['params']; } add after it if (isset($params['product_id']) ) { $products_quantity_query = tep_db_query("select products_quantity from products where products_id = " . (int)$params['product_id']); $products_quantity = tep_db_fetch_array($products_quantity_query); if ($products_quantity['products_quantity'] < 1) { $button .= ' disabled="disabled" '; $title = 'Out Of Stock'; $icon = 'fa fa-times-circle'; $style = 'btn-warning'; } } in product_info.php find this tep_draw_button(IMAGE_BUTTON_IN_CART, 'fa fa-shopping-cart', null, 'primary', NULL, 'btn-success') replace with this tep_draw_button(IMAGE_BUTTON_IN_CART, 'fa fa-shopping-cart', null, 'primary', array('product_id' => $product_info['products_id']), 'btn-success') Omar Hi Omar, just to give you a bit of feedback on the above changes affecting the product_info page and also your out of stock ribbon contribution, both work nicely and the changes above mean that the product_info page also reflect the out of stock status though not with the ribbon but that does not matter. The code in my Edge version was not quite as shown above and I had to change (around line 203) <div class="col-xs-6 text-right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'fa fa-shopping-cart', null, 'primary', array('params' => 'data-has-attributes="' . (($products_attributes['total'] > 0) ? '1' : '0') . '" data-in-stock="' . (int)$product_info['products_quantity'] . '" data-product-id="' . (int)$product_info['products_id'] . '"'), 'btn-success btn-product-info btn-buy'); ?></div> TO <div class="col-xs-6 text-right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'fa fa-shopping-cart', null, 'primary', array('product_id' => $product_info['products_id']), 'btn-success'); ?></div> and my original product_listing was (around line 169) if (PRODUCT_LIST_BUY_NOW > 0) { $prod_list_contents .= ' <div class="col-xs-6 text-right">'; $prod_list_contents .= tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . (int)$listing['products_id']), NULL, array('params' => 'data-has-attributes="' . ((tep_has_product_attributes((int)$listing['products_id']) === true) ? '1' : '0') . '" data-in-stock="' . (int)$listing['in_stock'] . '" data-product-id="' . (int)$listing['products_id'] . '"'), 'btn-success btn-product-listing btn-buy'); $prod_list_contents .= ' </div>'; } and is now (as you advised) if ( tep_get_products_stock($listing['products_id']) > 0 ) { $prod_list_contents .= ' <div class="col-xs-6 text-right">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'fa fa-shopping-cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), NULL, NULL, 'btn-success btn-sm') . '</div>'; } else { $prod_list_contents .= ' <div class="ribbon red"><span> '. TABLE_HEADING_OUT_OF_STOCK . '</span></div>'; } great stuff Omar, many thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.