mafiouso Posted August 13, 2015 Share Posted August 13, 2015 (edited) http://addons.oscommerce.com/info/7787 can anyone help with tihs? this addon is the only one that is recent and seems to work ... ALMOST.. the first 2 steps are doable. and work. but this is where im stuck. In catalog/includes/modules/product_listing.php FIND: case 'PRODUCT_LIST_BUY_NOW': $lc_text = TABLE_HEADING_BUY_NOW; $lc_align = 'center'; break; REPLACE WITH: case 'PRODUCT_LIST_BUY_NOW': // BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 if ($listing['products_price']> '0') //fix for call for price $lc_text = TABLE_HEADING_BUY_NOW; else $lc_text = ' '; // EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 $lc_align = 'center'; break; FIND: case 'PRODUCT_LIST_BUY_NOW': $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; break; REPLACE WITH: case 'PRODUCT_LIST_BUY_NOW':// BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 if ($listing['products_price']> '0') //fix for call for price // EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; break; * SAVE AND CLOSE FILE in my version 2.3.4 i have something like this: $prod_list_contents .= '</div><!-- end PLprice -->';$prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= ' <td>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; break; i have no idea how to make that work? Edited August 13, 2015 by mafiouso Quote Link to comment Share on other sites More sharing options...
♥kymation Posted August 14, 2015 Share Posted August 14, 2015 $prod_list_contents .= '</div><!-- end PLprice -->'; // BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 if ($listing['products_price']> '0') { //fix for call for price // EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 $prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= ' <td>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; } break; Not tested, but should work. Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
mafiouso Posted August 14, 2015 Author Share Posted August 14, 2015 thank you that worked but the alignments are messed up is it possible to "if 0" show this button rather then no nutton <?php echo tep_draw_button(IMAGE_BUTTON_NO_CART,'alert',null,'primary'); current code + what you shared. case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'center'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = TABLE_HEADING_IMAGE; $lc_align = ''; break; case 'PRODUCT_LIST_BUY_NOW':// BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 if ($listing['products_price']> '0') //fix for call for price $lc_text = TABLE_HEADING_BUY_NOW; else $lc_text = ' '; // EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 $lc_align = 'left'; $lc_width = '115px'; break; } $prod_list_contents .= '</div><!-- end PLprice -->'; // BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 if ($listing['products_price']> '0') { //fix for call for price // EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 $prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= ' <td>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; } break; Not tested, but should work. Regards Jim Quote Link to comment Share on other sites More sharing options...
mafiouso Posted August 14, 2015 Author Share Posted August 14, 2015 sorry to be more clear: i want there to be button rather than "text"so like this: In catalog/product_info.php FIND:<span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span> REPLACE WITH:<?php// BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0/* <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>*/ if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){?> <span class="buttonAction"> <a href="javascript:history.go(-1)"><?php echo tep_draw_button(IMAGE_BUTTON_BACK,'Back',null,'primary'); ?></a></span><?php} else {?> <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span><?php}// EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0?> rather then this: $prod_list_contents .= '</div><!-- end PLprice -->';// BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0 if ($listing['products_price']> '0') { //fix for call for price// EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0$prod_list_contents .= '<div class="PLbutton">';$prod_list_contents .= ' <td>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>';$prod_list_contents .= '</div><!-- end PLbutton -->';}break; what i have in product info.php is (working) <div class="buttonSet"><?php// BOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0/* <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>*/ if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){?> <span class="buttonAction"> <a href="javascript:history.go(-1)"><?php echo tep_draw_button(IMAGE_BUTTON_NO_CART,'alert'); ?></a></span><?php} else {?> <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span><?php}// EOF: MOD - EASY CALL FOR PRICE 2.3.1v1.0?> <?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?></div> thanks Quote Link to comment Share on other sites More sharing options...
mafiouso Posted August 14, 2015 Author Share Posted August 14, 2015 this is my best guess, would be grateful for any help ???? if ($listing['products_price']> '0') ???? if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){ $prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= '<td>' . tep_draw_button(IMAGE_BUTTON_NO_CART,'alert') . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; } else { $prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= '<td>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; } break; Quote Link to comment Share on other sites More sharing options...
mafiouso Posted August 14, 2015 Author Share Posted August 14, 2015 fuckkkkkkkkkkkkkkkkkkkkkkk... i think i worked it out. can anyone confirm if this is ok? if ($listing['products_price']> '0'){ $prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= '<td>' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link($PHP_SELF, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])) . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; } else { $prod_list_contents .= '<div class="PLbutton">'; $prod_list_contents .= '<td>' . tep_draw_button(IMAGE_BUTTON_BUY_NO,'alert') . '</td>'; $prod_list_contents .= '</div><!-- end PLbutton -->'; } break; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.