19 replies [Last post]
Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Was this information Helpful?

Hello everyone. My site has now gone live YIPPPEEEEEEE.

First things first, thank you for the Ubercart Development, and the intergration of LightBox..... awsmoe.

I have one thing I need to know, I have some products of which are not released as yet. I still want to put them on my site. Is there a way of instead of putting a price, I can put POA or something so they cannot be purchased until a specific time?

Any help is greatly appreciated

Squidge

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Prices TBC? POA? Can it be done?

..can it be done?...

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Re: Prices TBC? POA? Can it be done?

can anyone help out at all?

dibbd's picture
Offline
Joined: 02/17/2009
Juice: 65
Re: Re: Re: Prices TBC? POA? Can it be done?

What does POA mean anyway?

And this isn't probably what you want, but you could always add the products but not publish them.

But it sounds like you want to have them published, but just have the "BUY" button disabled or something?

--
Certified Medisoft reseller.

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Re: Re: Re: Prices TBC? POA? Can it be done?

thats what i would like to be able to do. is there away to disable the button on certain products?

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Modification

This could be modified to fit your needs.

http://www.ubercart.org/forum/support/543/items_sale_how

The field would appear or be removed depending on what price was placed in the list_price field when editing each product. You would still have the issue of removing the add to cart button, etc.

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Alaska: Thanks for pointing

Alaska:

Thanks for pointing out the link.

I have spoken with the shop owner, and he has explained in better detail as to what is wanted.

Basically:
It's a UK shop that has some american products, he has been given price's, image's, and SKU's. But at present they cannot send some of the items to the UK.

So the owner would like to still have the products online, but have istead of a numerical pricing, he would like to have POA (Price on Arival), TBC (To Be Confirmed). And also to have the Add to Cart button disabled on these products as well.

How can the coding be edited (if i can do this) so the Sell_Price is a alphanumerical value, so it will show either TBC or POA.

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Buy Now

The PHP script changes the displayed output. Have this online in Uber 1.6 and it works well. See PNGs.

If the list price is 0.00 and the sell price is 62.43 the standard output is displayed. If the list price is 62.43 and the sell price is 34.88 then the Buy Now is displayed.

This is determined by the logic in the first line. This could be changed so that if the list price were equal to 999.99 then your TBC message would be displayed as an idea.

Basically to alter, remove the $ and $list_price and change the Buy Now to TBC in the top half of the code.

Keep in mind that your "node.tpl.php" file will have to be changed.

Someone else may have a different solution and a way to hide the add to cart button. Not real found of the idea of having to change the list/sell price to make it work. But it could be a simple solution if you can put up with that issue. Also, have not tested any of these mods so you are on your own in that regard.

AttachmentSize
standard_price.png 30.3 KB
buy_now.png 30.16 KB
Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Buy Now

Thank you i'll give it a try. Where is the node.tpl.php file?

EDIT:Sorry still new to Drupal Modules. I have found the theme node.tpl.php, is this the correct one?

Edit:Ok, I added the CSS text to the theme style.css, and also added the PHP to the Theme node.tpl.php file

The attached image is what I am getting

AttachmentSize
untitled.GIF 10.21 KB
Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Re: Buy Now

Would it make any difference that your using Ubercart 1.x, and i am using 2.x

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Modification for Product Display

Have no experience with Drupal 6 or Uber 2 at this point.

Here is some modified code that you may want to try. Not being a PHP person, there could be some things that need cleaning up, etc.

The logic is setup so that if the list_price is equal to 99.99 the button will not display and Price on Arrival and To Be Confirmed will show. And for any other price the display will be normal, with a button and sell price. See PNG.

Any amount can be placed in the list price field. Just change the first line of logic to reflect any changes. Also modify the CSS file for font size/color, etc.

<?php  // list price hide button - will only display if list price is equal to 99.99 ?>

<div class="price">

<?php print $node->content['body']['#value'];  ?>

<?php
if ($list_price =='99.99') {
print
"<div class=\"price-box\">"."<p>"."<span class=\"our-price\">". "Price on Arrival" . "</span>" . "</p>" . "<p class=\"offer-text\">To Be Confirmed" . "</span>" . "</p></div>";
print
"<br><br>";
}else {
print
"<div class=\"price-box\"><p class=\"sell-price\">". "$" . $sell_price . "</p></div>";
print
"<div id=\"cartButtons\">";
print
$node->content['add_to_cart']["#value"];
print
"</div>";
}
?>

</div>

<?php  // Cart button display - - Comment out below to hid button ?>

<!--<div id="cartButtons"> -->
<?php // add to cart buttons ?>
<?php // print $node->content['add_to_cart']["#value"]; ?>

<!--</div> -->
</div>
</div>

______________________________________

/**  CSS -- place in your theme node.tpl.php file - For POA and TBC  **/

/**  Price Box Display  **/

.price .price-box {
font-size: 12px;
text-align: left;
}

.price .sell-price {
font-size: 125%;
color: #000;
}

.price .offer-text {
color: #2B45B3;
margin-top: -10px;
margin-bottom: 0px;
font-weight: bold;
font-size: 125%;
}

.price .our-price {
color: green;
}

AttachmentSize
poa.png 28.5 KB
Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Alaska: You are a star, i'll

Alaska:

You are a star, i'll give the code a go.

loocher's picture
Offline
Joined: 02/21/2009
Juice: 211
Re: Prices TBC? POA? Can it be done?

You might want to have a look at the "ubercart price quote" module. This allows you to add a request quote button instead of an add to cart one.

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Re: Prices TBC? POA? Can it be done?

Loocher: Is this compatible with Ubercart 2.x?

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Alaska: I have put both

Alaska:

I have put both parts of the code into the node.tpl.php of my theme, but it still doesnt seem to work how your PNG shows.

Does it have to go in a specific area of the Node.tpl.php? Do both parts go in there?

Sorry to ask so many questions, but I am still new to all of the Drupal stuff

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Ok, so far: I have out this

Ok, so far:

I have out this into the uc_product.css and have the POA and TBC showing in the colour green and blue Smiling

/**  CSS -- place in your theme node.tpl.php file - For POA and TBC  **/

/**  Price Box Display  **/

.price .price-box {
font-size: 12px;
text-align: margin-right;
}

.price .sell-price {
font-size: 125%;
color: #000;
}

.price .offer-text {
color: #2B45B3;
margin-top: -10px;
margin-bottom: 0px;
font-weight: bold;
font-size: 125%;
}

.price .our-price {
color: red;

But if i remove the 99.99 from the list_price, and put a normal sell_price, the sell price appears twice. Once where it would by default, the second as shown in the PGN2 file.

I am strugling with the PHP code. I have put this into node.tpl.php and when i put 99.99 into list_price the POA and TBC appears, but the add to cart button is still clickable.

Any more advice?

AttachmentSize
POA.PNG 22.46 KB
PNG2.PNG 23.22 KB
Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Code Placement

The CSS does NOT go into your node.tpl.php file. The CSS goes into the CSS file for the theme that you are using. Place at the end of that CSS file. That file is most likely called style.css. My error in the previous set of instructions.....

Did test this on Uber 1.6 and it works well. You could use sell_price in place of list_price. If sell_price were used it could be set to 0.00 for your product. That way in your workflow you would know that any product with a 0.00 will display your POA/TBC message without a button.

     $output .= '</a>';
    }
  }
  $output .= '</div>';
  $rel_count++;
  print $output; ?>

</div>

PHP code goes here in the theme that you are using ........... NO CSS here.......  CSS goes in style.css for your selected theme.

<div class="clear-block clear">
<div class="meta">
<?php if ($taxonomy): ?>
<div class="terms"><?php print $terms ?></div>
<?php endif;?>
</div>

Keep in mind that this is the code for node.tpl.php for Uber version 1.6 and Drupal 5.14. Do not know if this will or will not work for Drupal 6.x. Some things have changed from Drupal 5.x to Drupal 6.x. You will need to see if the the node.tpl.php files are the same or different for these two Drupal versions. Or perhaps someone else in the forum will supply that information for you.

Gavalar's picture
Offline
Joined: 12/24/2008
Juice: 101
Re: Code Placement

Thank you for your quick reply Alaska.

It doesnt seem to work as your PNG shows with Drupal 6.x and Ubercart 2.x

Managed to get the POA and TBC to show, but when ever i put a sell price in it would show where the POA and TBC would show as well.

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
POA Issue

Squidge:

Send me a PM if you would.

Thanks.

netslave's picture
Offline
Joined: 05/22/2008
Juice: 187
Solution ?

A solution for this problem could a stock module + views.

When you realise your whole output over views, you can use field display and check the stock in a template.

Also you have a correct implementation because products out of stock are not sellable. So add to cart should not be possible.