chrometweaks.org

Registered domain with iPage.com and a advertisment is stuck on it?

Click Here To View All Answers...


First question I have is Registered domain with iPage.com and a advertisment is stuck on it? Looking forward for any response. My other question... I have a few items that have links to other sites for purchase..

These items I enter as zero dollars and zero weight in the store..

I have searched the forums here, and by reading posts have removed the price and add to cart from all items with zero price by adding this line:.

($product_info['products_price'] > 0).

However cant find anything in the forums on the buy now button except to remove it completly which I dont want to do..

I need to remove the buy now button for these zero price items only..

I assume it is in the file product_listing.php however I cant seem to figure out exactly what I need to place in the file..

If any one has an idea, please let me know..

I am using ms2.

Thanks,.

M-C..

Comments (94)

I'm stumped. I'm not so sure what is the right answer to your question. I'll do some research and get back to you if I got an decent answer. You should email the people at iPage as they probably know..

Comment #1

See, the thing is that there is only one file, product info.php, and that file displays the product information which is stored in the database, not on the server. So if you remove it from product_info.php then it wouldnt show up on any item..

Maybe though, you can do this. You can copy the PHP sorce code for the buy now button, and ad it in as part of the product description? Then delete the one on the bottom. Dont know if that will work...

Comment #2

Thank you for replying......

The only entries for the buy now button I can find are in the.

Product_listing.php file. I tried adding a "if"statement to it there, as I see other entries there with "if" statements. But I tried several things and it didnot work..

So you are thinking maybe I can add the info for the Buy Now button to the product description then modify it there? WOuld this require removing it from themproduct_listing?.

Thanks for the idea, Ill give that a try later.....

Thanks..

M-C..

Comment #3

Hollice,.

I received your email,.

Here is how you remove the price and in cart button from displaying if price is zero:.

In your product_info.php.

Find this code:.

<td class="pageHeading" align="right" valign="top"><?php echo ($products_price : ''); ?></td>.

And replace with this:.

<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>.

For the in cart button:.

Find this code:.

<td class="main" align="right">.

<?php echo (tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) : ''); ?></td>.

And replace with:.

<td class="main" align="right">.

<?php echo (($product_info['products_price'] > 0) ? tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) : ''); ?></td>.

Hope this helps you,.

If you find anything for buy now button please let me know. The buy now button is part of my theme, and would really take away from the iPage site if I removed it altogether, so hoping some one has an answer..

This post has been edited by.

Missed-code.

: 07 January 2004, 18:04..

Comment #4

Michael,.

Thank you!.

Hope you get the answers that you need..

Hollice..

Comment #5

NP Hollice, glad I could help!.

Any one with any more ideas on removing the buy now button on items with zero price??.

Thanks,.

M-C..

Comment #6

I think you would need to put a similar if statement in index.php somewhere in this code:.

   $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,.

                        'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,.

                        'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,.

                        'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,.

                        'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,.

                        'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,.

                        'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,.

                        'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

Maybe something like:.

[/CODE].

If(PRODUCT_LIST_PRICE != "0") {.

'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);.

}.

[CODE].

This isn't tested, and may not be the exact code you need. (They made me take java classes, and then vb classes, and now I use PHP and not either of the other two and it just confuses me!)..

Comment #7

LMAO!.

Thanks for the idea, I am going to give that a try..

Thanks,.

M-C..

Comment #8

Just a thought... instead of removing the add to cart button, how about replacing it with a contact for price button that links to the contact us page.....

Comment #9

How would I go about doing this? I would like to have my customers contact us through the contact us page, come by our location, or call for availability...

Comment #10

Hi,.

I had similar issues with trying to remove the "Buy" button on items where $ value = 0.

Have a look at this post.

Http://forums.oscommerce.com/index.php?sho...=0&#entry246845.

Hope they help?.

Cheers,.

J..

Comment #11

I'm thinking.... totally untested.

<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>.

Should be a little more like.

<td class="pageHeading" align="right" valign="top"><?php if ($product_info['product_price'] = 0) {echo "Contact for price";} else { echo $product_price; } ?></td>.

And something kindof different for the add to cart button... anyone who knows what they're talking about want to have a crack at this?..

Comment #12

Ok, i've figured it out... it's 6am now so there might be some typos, but it's workin for me.....

For starters create new images for the add to cart and buy now buttons and upload them to /includes/languages/english/images/buttons/, then add a line to.

/includes/languages/english.php.

Around line 263.

Define('IMAGE_BUTTON_CONTACT_US', 'Contact Us');.

In product_info.php.

Around line 93.

<td class="pageHeading" align="right" valign="top"><?php echo ($products_price : ''); ?></td>.

Should look like.

<td class="pageHeading" align="right" valign="top"><?php echo ($product_info['products_price'] > 0) ? $products_price : 'Call for Price' ?></td>.

Around line 213.

<td class="main" align="right">.

<?php echo (tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif',  IMAGE_BUTTON_IN_CART) : ''); ?></td>.

Should look like.

<td class="main" align="right"><?php echo (($product_info['products_price'] > 0) ? tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) : '<a href="'.tep_href_link(FILENAME_CONTACT_US).'">'.tep_image_button('button_contact_us.gif', IMAGE_CONTACT_US).'</a>'); ?></td>.

In /includes/modules/product_listing.php.

Around line 112.

$lc_text = '&nbsp;'$currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']))'&nbsp;';.

Should look like.

$lc_text = '&nbsp;'(($listing['products_price'] > 0) ? $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : 'Call for price'). '&nbsp;';.

And around line 133.

$lc_text = '<a href="'tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))'action=buy_now&products_id='$listing['products_id'])'">'tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW)'</a>&nbsp;';.

Should look like.

$lc_text = '<a href="' .(($listing['products_price'] > 0) ? tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))'action=buy_now&products_id='$listing['products_id'])'">'tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) : tep_href_link(FILENAME_CONTACT_US).'">'.tep_image_button('button_contact_sm.gif', IMAGE_CONTACT_US))'</a>&nbsp;';.

And I think that does it... let me know if it works for you too......

Comment #13

Very similar modifications must be made to products_new.php and product_reviews.php... if anyone needs help i'll post the code..

Comment #14

Thank you EVERYONE for your help! I used a combination of things from several people. Here are my results and working perfectly fine!.

Remove Price, add to cart, and buy now button ONLY if price is $0 and display it otherwise. Reason: I have some items that are only purchased from another web site, Affiliates basicly, but displayed in the catalog as a product with a link to Buy in the product description..

In your product_info.php.

Find this code:.

<td class="pageHeading" align="right" valign="top"><?php echo ($products_price : ''); ?></td>.

And replace with this:.

<td class="pageHeading" align="right" valign="top"><?php echo (($product_info['products_price'] > 0) ? $products_price : ''); ?></td>.

Find this code:.

<td class="main" align="right">.

<?php echo (tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif',  IMAGE_BUTTON_IN_CART) : ''); ?></td>.

And replace with:.

<td class="main" align="right">.

<?php echo (($product_info['products_price'] > 0) ? tep_draw_hidden_field('products_id', $product_info['products_id'])tep_image_submit('button_in_cart.gif',  IMAGE_BUTTON_IN_CART) : ''); ?></td>.

Next edit your product_listing.php.

Find this code:.

$lc_text = '&nbsp;'$currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']))'&nbsp;';.

And replace with:.

$lc_text = '&nbsp;'(($listing['products_price'] > 0) ? $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) : '')'&nbsp;';.

Find:.

$lc_text = '<a href="'tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))'action=buy_now&products_id='$listing['products_id'])'">'tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW)'</a>&nbsp;';.

And replace with:.

$lc_text = (($listing['products_price'] > 0) ? '<a href="'tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))'action=buy_now&products_id='$listing['products_id'])'">'tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW)'</a>&nbsp;' : '&nbsp;');.

I do not use the reviews or new products modules, I assume these will need a similar modification if you use them...

Comment #15

I have a few items that have links to other sites for purchase..

These items I enter as zero dollars and zero weight in the store..

I have searched the forums here, and by reading posts have removed the price and add to cart from all items with zero price by adding this line:.

($product_info['products_price'] > 0).

However cant find anything in the forums on the buy now button except to remove it completly which I dont want to do..

I need to remove the buy now button for these zero price items only..

I assume it is in the file product_listing.php however I cant seem to figure out exactly what I need to place in the file..

If any one has an idea, please let me know..

I am using ms2.

Thanks,.

M-C..

Comment #16

Does no one know how to remove the buy now button only if price is zero?.

This has to be simple like everything else in OSC is, I just dont know how.

The last time I asked was 11-18-03, unanswered........

Http://forums.oscommerce.com/index.php?showtopic=66621&hl;=.

And a post before that when I asked I said something about my posts going unanswered I was told very few posts ever go answered and then later my post was deleted, I guess I ofended some one by saying it........... Please dont do that this time..

Hope some one can help me or has an idea..

Thanks,.

M-C..

Comment #17


This question was taken from a support group/message board and re-posted here so others can learn from it.