ce7 Posted January 7, 2020 Share Posted January 7, 2020 Hi Installed Phoenix 1.0.4.0 version, at the front page, has few products, but only one of them has BUY NOW shopping cart icon show up, how can I change the code to make all the product has the shopping cart icon/button? (want to change the shopping cart icon to button BUY too) Also installed special product content, the BS version code regarding to the button and the css style are different to CE version, where can I find the original code of css file and paste to user.css so i can modify it to match the new CE style? (to have special content VIEW button to show up and to change the BUY button style to match new product content) Many thanks! Lyn Link to comment Share on other sites More sharing options...
ce7 Posted January 7, 2020 Author Share Posted January 7, 2020 This is what I expected, @ includes/modules/product_listing.php tried to change the code, but it seems not change any style change from btn-light btn-product-listing btn-buy to btn-info btn-product-listing btn-buy // if ($has_attributes == 0) $prod_list_contents .= tep_draw_button(IS_PRODUCT_BUTTON_BUY, '', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id', 'sort', 'keywords', 'cPath')) . 'action=buy_now&products_id=' . (int)$listing['products_id']), NULL, array('params' => 'data-has-attributes="' . $has_attributes . '" data-in-stock="' . (int)$listing['in_stock'] . '" data-product-id="' . (int)$listing['products_id'] . '"'), 'btn-light btn-product-listing btn-buy') . PHP_EOL; if ($has_attributes == 0) $prod_list_contents .= tep_draw_button(IS_PRODUCT_BUTTON_BUY, '', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id', 'sort', 'keywords', 'cPath')) . 'action=buy_now&products_id=' . (int)$listing['products_id']), NULL, array('params' => 'data-has-attributes="' . $has_attributes . '" data-in-stock="' . (int)$listing['in_stock'] . '" data-product-id="' . (int)$listing['products_id'] . '"'), 'btn-info btn-product-listing btn-buy') . PHP_EOL; Link to comment Share on other sites More sharing options...
♥ecartz Posted January 7, 2020 Share Posted January 7, 2020 2 hours ago, ce7 said: how can I change the code to make all the product has the shopping cart icon/button? Look at what the code is doing: if ($has_attributes == 0) So if the product doesn't have attributes, it shows a buy button. The reason why it does this is because it doesn't know if the attribute is required or not. If you delete that check, the buy button will show for all products. But it may do the wrong thing for products with attributes. A simpler way to make all the products show buy buttons is to not have attributes on your products. 2 hours ago, ce7 said: change from btn-light btn-product-listing btn-buy to btn-info btn-product-listing btn-buy When I make that change, I get the effect that you want. Note that I disagree with that change. It makes it much harder to tell which button is which. That would be a confusing buyer experience. Always back up before making changes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.