Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2007
    Posts
    7
    Plugin Contributions
    0

    help question Comming soon label when price is not setted or price is 0

    Sorry for my english...

    I want to show in the products lists a label/button "comming soon" when the price is not definied or is Zero.

    sometimes I need to put a new Item in the website before have it in stock. When I do that normally dont feel the price case or simply put zero on the price.
    When I do that, in the product silting show the "sold out" label.

    I want to see the "sold out" label when the product have finished only (have price but is out of stock)
    And I want to see the "coming soon" label when the product have no price.

    Any idea how to do that ?

    Many thanks

  2. #2
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Comming soon label when price is not setted or price is 0

    I did something similar for someone on the product info page, maybe you can use it as a direction for the product listing page.

    PHP Code:
    <?php
    $products_price 
    zen_products_lookup((int)$_GET['products_id'], 'products_price');

        if (
    $products_price == 0) {
     echo 
    'Price Coming Soon!';
      } else {
     echo 
    '';
    }
    ?>

  3. #3
    Join Date
    Oct 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Comming soon label when price is not setted or price is 0

    Thank you for quick answer.
    Really I want to see that on the new product list. Here you can see my website new product list:

    http://www.pcmediainformatica.com/ca...e=products_new

    There are articles without price because are new and will be available in few days so I need to show that "coming soon" text.

    Any idea where must I insert your code ?

  4. #4
    Join Date
    Oct 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Comming soon label when price is not setted or price is 0

    I have tried editing product_listing.php, templates but still nothing.
    When I change something to test, I see on main product list the changes, not in the new product list.

  5. #5
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Comming soon label when price is not setted or price is 0

    This is what I did for the /includes/modules/YOUR_TEMPLATE/product_listing.php file

    find this:
    PHP Code:
            case 'PRODUCT_LIST_PRICE':
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
            
    $lc_align 'right';
            
    $lc_text =  $lc_price;

            
    // more info in place of buy now 
    change to this:

    PHP Code:
            case 'PRODUCT_LIST_PRICE':
            
    $lc_price zen_get_products_display_price($listing->fields['products_id']) . '<br />';
            
    $lc_align 'right';
            
    $lc_text =  $lc_price;

    if (
    $listing->fields['products_price'] == 0) {
            
    $lc_text .= 'Price Coming Soon!';
      } else {
            
    $lc_text .= '';
    }

            
    // more info in place of buy now 
    You can see it here

  6. #6
    Join Date
    Oct 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Comming soon label when price is not setted or price is 0

    Thank you rbarbour

    I think that is the correct way.

    In this example, if you press new products, the code doesnt work. It works on the general price listing but not in the new products listing...
    Iīll try to find the solution and Iīll publish here

    Many thanks

  7. #7
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Comming soon label when price is not setted or price is 0


  8. #8
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Comming soon label when price is not setted or price is 0

    for the tpl_modules_products_new_listing.php

    try

    find:
    PHP Code:
          if ((PRODUCT_NEW_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y') and zen_check_show_prices() == true) {
            
    $products_price zen_get_products_display_price($products_new->fields['products_id']);
            
    $display_products_price TEXT_PRICE ' ' $products_price str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_PRICE31)) . (zen_get_show_product_switch($products_new->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($products_new->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON '<br />' '') : '');
          } else {
            
    $display_products_price '';
          } 
    add below like:
    PHP Code:
          if ((PRODUCT_NEW_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_new->fields['products_id']) == 'Y') and zen_check_show_prices() == true) {
            
    $products_price zen_get_products_display_price($products_new->fields['products_id']);
            
    $display_products_price TEXT_PRICE ' ' $products_price str_repeat('<br clear="all" />'substr(PRODUCT_NEW_LIST_PRICE31)) . (zen_get_show_product_switch($products_new->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($products_new->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON '<br />' '') : '');
          } else {
            
    $display_products_price '';
          }

    if (
    $products_new->fields['products_price'] == 0) {
            
    $display_products_price .= 'Price Coming Soon!';
      } else {
            
    $display_products_price .= '';


  9. #9
    Join Date
    Oct 2007
    Posts
    7
    Plugin Contributions
    0

    Default Re: Comming soon label when price is not setted or price is 0

    Thank you again rbaorbour

    Thatīs the solution , but I did little changes... What i want exactly is to hide the "SOLD OUT" label and replace it with a "COMONG SOON" when there are no price setted up or the price is zero so...
    I did this changes
    Edited the file: /includes/templates/template_default/templates/tpl_modules_products_new_listing.php

    originally:
    PHP Code:
    $the_button $link;
            
    $products_link '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' $products_new->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            
    $display_products_button zen_get_buy_now_button($products_new->fields['products_id'], $the_button$products_link) . '<br />' zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_BUY_NOW31));
          } else { 
    inserted this code:
    PHP Code:
            $products_link '<a href="' zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' $products_new->fields['products_id']) . '">' MORE_INFO_TEXT '</a>';
            if (
    $products_price == ''){
                    
    $display_products_button ' Proximamente';
                    } else {
                    
    $display_products_button =  zen_get_buy_now_button($products_new->fields['products_id'], $the_button$products_link) . '<br />' zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />'substr(PRODUCT_NEW_BUY_NOW31));
                    }
          } else { 
    Now the new products without price present a test that say "proximamente" (coming soon in english)

    The last step is to load a button that say "coming soon" instead of the "proximamente" text

  10. #10
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Comming soon label when price is not setted or price is 0

    in /includes/languages/english/YOUR_TEMPLATE/button_names.php

    add:
    PHP Code:
    define('BUTTON_COMING_SOON''button_coming_soon.gif'); 
    define('BUTTON_COMING_SOON_ALT''Coming Soon'); 
    if the file doesn't exist - create it

    then in:
    /includes/templates/YOUR_TEMPLATE/templates/tpl_modules_products_new_listing.php

    where you put:
    PHP Code:
    $display_products_button ' Proximamente'
    change to:
    PHP Code:
    $display_products_button zen_image_button(BUTTON_COMING_SOONBUTTON_COMING_SOON_ALT'class="comingSoonButton"'); 
    Also you should be making your changes to files within the cherry_zen folders and NOT the template_default folders for all your changes will be lost upon upgrading.

    If a file doesn't exist in the cherry_zen folder just copy it from the template_default folder

    hope this helps!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Displaying Starting at: before price when price by letters
    By pcaines in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 23 Oct 2010, 11:53 AM
  2. Need attribute price to display total price not incremental price
    By Rickk123 in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 2 Sep 2010, 06:26 PM
  3. Comming soon side box
    By cwusa in forum Addon Sideboxes
    Replies: 0
    Last Post: 27 Aug 2009, 06:40 PM
  4. Net and Gross price the same when entering product price
    By Craig Robbo in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 6 Feb 2009, 09:47 AM
  5. Sale Price when Listed but not When Added to Cart
    By Mang in forum General Questions
    Replies: 3
    Last Post: 31 Mar 2007, 03:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR