Jump to content

mariokristo

Members
  • Content count

    3
  • Joined

  • Last visited

  1. No answer, I found the solution for those who use this contrubution with sold out button. In catalog/recently_viewed.php Find: $products_query_raw = "select m.manufacturers_name,rv.rec_v_id, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added,pd.products_description from " . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id in (" . $prod_viewed . ") and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rv.rec_v_id"; Replace with: $products_query_raw = "select m.manufacturers_name,rv.rec_v_id, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added,pd.products_description from " . TABLE_PRODUCTS . " p, recently_view as rv, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id where p.products_id in (" . $prod_viewed . ") and p.products_status = '1' and p.products_id = rv.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by rv.rec_v_id"; Find: <?php echo TEXT_MANUFACTURER . '<br>' . $products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br><br>' . ' ' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '</a>' . tep_draw_form('buy_now' . $products['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']), 'POST') . '<span align="right" >' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . '</span></form> ' . '</a>'; ?> Replace with: <?php echo TEXT_MANUFACTURER . '<br>' . $products['manufacturers_name'] . '<br><br>' . TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br><br>' . ' ' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '</a>'; ?> <?php // Begin Sold Out If ($products['products_quantity']>0) { echo tep_draw_form('buy_now' . $products['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']), 'POST') . '<span align="right" >' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . '</span></form> ' . '</a>'; } else { echo tep_image_button('button_sold_out.gif', IMAGE_BUTTON_SOLD_OUT,'align="absbottom"') . '</form> ' . '</a>'; } // End Sold Out--> Find: <?php echo TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br><br><br>' . ' ' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '</a>' . tep_draw_form('buy_now' . $products['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']), 'POST') . '<span align="right" >' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . '</span></form> ' . '</a>'; ?> Replace with: <?php echo TEXT_PRICE . ' ' . '<b>' . $products_price . '</b><br><br><br>' . ' ' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, 'products_id=' . $products['products_id']) . '">' . '</a>'; ?> <?php // Begin Sold Out If ($products['products_quantity']>0) { echo tep_draw_form('buy_now' . $products['products_id'], tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products['products_id']), 'POST') . '<span align="right" >' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'align="absbottom"') . '</span></form> ' . '</a>'; } else { echo tep_image_button('button_sold_out.gif', IMAGE_BUTTON_SOLD_OUT,'align="absbottom"') . '</form> ' . '</a>'; } // End Sold Out--> Everything is ok for me. This prevents purchases on this page when stock = 0. I hope that this will help someone, the code is not terrible but it works.
  2. Thanks for this great contribution :rolleyes: Sorry for my poor english, i'm french. I'm using a sold out button when the quantity of products is 0. In the recently viewed page, all products can be added to the cart by the customer, I would like to add the "sold out" instead of the button "buy" when the quantity of product = 0. I am not a programmer, I think having to put this code (or something like that) on the page, but I do not know where and how: if($product_info['products_quantity'] <= 0 || $product_info['products_status']==0) echo tep_image_button('button_sold_out.gif', IMAGE_BUTTON_SOLD_OUT); Thanks for all Best regards
×