Forums / Templates, Stylesheets, Page Layout / more info link that shows up when item is sold out

more info link that shows up when item is sold out

Locked

Started by tanyaslogos on 18 Nov 2009, 1:41 PM · Views: 1,272

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
18 Nov 2009, 1:41 PM
#1
tanyaslogos avatar

tanyaslogos

New Zenner

Join Date:
Aug 2008
Posts:
11
Plugin Contributions:
0

more info link that shows up when item is sold out

I have wracked my brain on this one and have finally decided to beg for help.

This is my first try at installing and customizing a zencart so please forgive me if I sound stupid.

I know (from searching this forum and reading every post I could find with this topic) that I can remove the ...more info text from the english.php file which will make the text go away.

You can see what I mean here:

http://finehandwear.com/store/index.php?main_page=index&cPath=6

Problem is that there is still a space left behind where the text was supposed to be.

I also found the area in the product_listing.php file located in modules that controls this function but I can't for the life of me figure out what to remove and what to keep. I tried to remove the bolded text and it didn't do anything.

       // more info in place of buy now
        $lc_button = '';
        if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
          $lc_button = '[B]<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>[/B]';
        } else {
          if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
            if (
                // not a hide qty box product
                $listing->fields['products_qty_box_status'] != 0 &&
                // product type can be added to cart
                zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
                &&
                // product is not call for price
                $listing->fields['product_is_call'] == 0
                &&
                // product is in stock or customers may add it to cart anyway
                ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
              $how_many++;
            }
            // hide quantity box
            if ($listing->fields['products_qty_box_status'] == 0) {
              $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
            } else {
              $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
            }
          } else {
// qty box with add to cart button
            if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
              $lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
            } else {
              $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
            }
          }
        }
        $the_button = $lc_button;
        $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
        $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');

I just want to have the SOLD OUT image in line with the BUY NOW buttons and to lose the ...more info in the process.

Any help would be greatly appreciated.

Sincerely, Tanya

18 Nov 2009, 10:21 PM
#2
pjb923 avatar

pjb923

Zen Follower

Join Date:
Jan 2005
Location:
NY
Posts:
135
Plugin Contributions:
0

Re: more info link that shows up when item is sold out

Try changing the following:

Instead of removing the bolded line completely, try changing it to

$lc_button = '';

Then try changing line 240 from:

$lc_text = implode('<br />', $product_contents);

To:

$lc_text = implode('', $product_contents);

You may need to manually add back some <br /> tags if you want more spacing after editing the implode line.

18 Nov 2009, 11:31 PM
#3
tanyaslogos avatar

tanyaslogos

New Zenner

Join Date:
Aug 2008
Posts:
11
Plugin Contributions:
0

Re: more info link that shows up when item is sold out

Great minds think alike! lol

I actually tried both of those options last night after reading the different posts on this board. Unfortunately neither of them do the job. :(

I might be misunderstanding you though so I wanted to clarify something.

When I remove the bold anchor tag it actually creates the $lc_button = ''; since that tag was inside the apostrophe's of that code.

Should I be adding another instance of $lc_button=''; inside that code?

Ohhh and removing the line break on line 204 just removes the space that is between the bottom of the image and the title. :(

I am willing to try anything and everything if you have any more thoughts on it. :)

Thanks SO MUCH for your help. It is greatly appreciated.

18 Nov 2009, 11:35 PM
#4
tanyaslogos avatar

tanyaslogos

New Zenner

Join Date:
Aug 2008
Posts:
11
Plugin Contributions:
0

Re: more info link that shows up when item is sold out

removed.

18 Nov 2009, 11:40 PM
#5
tanyaslogos avatar

tanyaslogos

New Zenner

Join Date:
Aug 2008
Posts:
11
Plugin Contributions:
0

Re: more info link that shows up when item is sold out

For anyone else struggling with this issue.

This is the part that I removed to get rid of the space and the text.

        $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . ( ($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
        $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . 

Thanks again Pjb923 for your help - you got me looking at the code differently which made me finally see the light. :)

19 Nov 2009, 12:14 AM
#6
pjb923 avatar

pjb923

Zen Follower

Join Date:
Jan 2005
Location:
NY
Posts:
135
Plugin Contributions:
0

Re: more info link that shows up when item is sold out

I'm glad to hear that you got it working. I must have misread your first post and thought you had the entire line bolded. Your code is correct.

I always struggle with all of the extra linebreaks in the product listing. Thanks for sharing your solution.

19 Nov 2009, 2:11 AM
#7
tanyaslogos avatar

tanyaslogos

New Zenner

Join Date:
Aug 2008
Posts:
11
Plugin Contributions:
0

Re: more info link that shows up when item is sold out

lol no worries - Since I am PHP illiterate I have a difficult time articulating what I need. :)

Oh and you're welcome for the post of the fix. It wasn't completely selfless on my part - I figure when I forget what I did to fix it I can find the answer on here. :)

That and I know what it is like to search in vain for answers so I hope this post will keep someone from tearing their hair out. :lamo: