Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Call for Price Changes


Mort-lemur

Recommended Posts

Posted

Hi,

 

Can't find a support thread for this one, so posting here.

 

I have installed the "easy call for price" contribution and in the most it is working fine.

 

However,

 

The install detailed changes to a file called product_listing_col.php - which I dont seem to have on my install.

 

Also although the items I have set to a price of -1 in admin show as "Call for Price" in the store, when viewing their category they still have a buy it now button so could be added to the cart with a price of -£1 which shouldnt happen.

 

Any Ideas please?

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Posted

Hi aagin,

 

Here is a link to the problem I am having LINK

 

You can see that the top item is Call for Price, but it still has a buy it now button so you can add it to the cart.

 

Thanks if anyone can help.........

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Posted

Hi Heather,

 

I'm not sure where or how one is to get a file called - product_listing_col.php

 

A likely solution to your problem of being able to purchase the item is to install this contribution - Show Sold Out Items.

 

Then all you would need to do is set the stock quantity to zero.

 

The contribution comes with a "Sold Out" button that would show in place of the "Buy Now" button and it would be a simple task to make something different.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Thanks Jim,

 

I will keep that at the back of my mind - but I would really like to get this working first.

 

I think the problem is with an If - Else statement in Product_listing.php.

 

This is the code:

 

		case 'PRODUCT_LIST_BUY_NOW':
	$lc_align = 'center';
	if ($listing[$x]['products_price']== CALL_FOR_PRICE_VALUE){ //fix for call for price
	$lc_text = '';
	} else {
	$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> ';
	}
	break; 
		}

 

Can anyone see a problem with this ?

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Posted

Hi Heather,

 

Sorry, I should have looked further at the products info page. I did not realize the contrib actually is supposed to remove the button. blush.gif

 

Have you tried comparing it to the code for product_info.php?

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Posted

Hi,

 

Yes tried all connotations of the IF- ELSE code, but I just cannot get the buy-now button to go away

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Posted

Cracked it !!! :)

 

After an afternoon of reading PHP tutorials I have managed to sort out the code.

 

The Buy-Now Button is removed for items which are "call for Price" and I have also gone a step further and used if-elseif-else statements to remove the buy-Now button from free downloadable product brochures.

 

If anyone wants the code let me know and I'll post it.

 

Thanks

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

  • 5 weeks later...
Posted

Cracked it !!! :)

 

After an afternoon of reading PHP tutorials I have managed to sort out the code.

 

The Buy-Now Button is removed for items which are "call for Price" and I have also gone a step further and used if-elseif-else statements to remove the buy-Now button from free downloadable product brochures.

 

If anyone wants the code let me know and I'll post it.

 

Thanks

 

 

HI Heather,

 

I am new in os commerce and I am trying to install Easy Call for Price I am having difficulties installing it. I did all the instructions in the package but it didn't work well in you said you cracked it can you please post the code here thanks!

Posted

HI Heather,

 

I am new in os commerce and I am trying to install Easy Call for Price I am having difficulties installing it. I did all the instructions in the package but it didn't work well in you said you cracked it can you please post the code here thanks!

 

Hi,

 

In product_info.php around line 301 I changed the code to read

<?php
if ($product_info['products_price'] == CALL_FOR_PRICE_VALUE){
?>
<td class="main" align="right"><a href="javascript:history.go(-1)"><?php echo tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
<?php
} elseif($product_info['products_price'] == FREE_VALUE){
?>
<td class="main" align="right"><a href="javascript:history.go(-1)"><?php echo tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE); ?></a></td>
<?php
} else {
?>
<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>
<?php
}
// EOF: MOD - EASY CALL FOR PRICE v1.4 ?>

 

in includes/modules/product_listing.php around line 131 I changed the code to read:

 

          case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
if ($listing['products_price']== CALL_FOR_PRICE_VALUE){ //fix for call for price
$lc_text = '  ';
} elseif($listing['products_price']== FREE_VALUE){ //fix for call for price
$lc_text = '  ';
} else {
$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> ';
}
break; 
       }

 

In includes/classes/currencies.php around line 73 I changed the code to :

 

// BOF: MOD - EASY CALL FOR PRICE v1.4
// return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
define ('CALL_FOR_PRICE_VALUE', -1);
define ('FREE_VALUE', 0);
// If you sell products for $0.00 and want to display "Call for Price!" for other products, set their price and the CALL_FOR_PRICE_VALUE to -1.
if ($products_price > CALL_FOR_PRICE_VALUE){
return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
} else {
define ('TEXT_CALL_FOR_PRICE', 'TEXT_CALL_FOR_PRICE');
// You can set CALL_FOR_PRICE_TEXT to anything you want. Its style is determined by the page it is displayed on. Changes made here will be visible throughout your site.
return TEXT_CALL_FOR_PRICE;
// BOF: MOD - EASY CALL FOR PRICE v1.4

 

So now I set the value of items I want to be call-for-price to -1 and for free downloads i set the value to 0.

 

Hope this helps.

Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...