CubeCartForums.org for CubeCart third-party documentation, modifications, skins and services

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Hide/Remove Price & Stock Info, Only when not in stock
dan lindley
post Dec 22 2011, 11:18 AM
Post #1


Newbie
Group Icon

Group: Members
Posts: 6
Joined: 29-November 11
Member No.: 27,088



Greets;

Has anyone come up with a mod, that hides/removes the Price and Stock information when a product has a stock level of 0?

I already have the mod installed for removal of cart and Buy button on the cat listing, just wondered if anyone had taken this a step further?

Many thanks

Dan
Go to the top of the page
 
+Quote Post
Brian Smither
post Dec 22 2011, 03:14 PM
Post #2


CubeCart Jedi Knight
Group Icon

Group: Supporter
Posts: 2,453
Joined: 11-June 07
From: Rocky Mountains
Member No.: 568



We can certainly inhibit the display of the price and stock level.

In the file /includes/content/viewProd.inc.php, find this section of code:
CODE
    if(salePrice($prodArray[0]['price'], $prodArray[0]['sale_price'])==FALSE){
        $view_prod->assign("TXT_PRICE",priceFormat($prodArray[0]['price']));
    } else {
        $view_prod->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($prodArray[0]['price'])."</span>");
    }
    $salePrice = salePrice($prodArray[0]['price'], $prodArray[0]['sale_price']);
    $view_prod->assign("TXT_SALE_PRICE", priceFormat($salePrice));
and make it look like this:
CODE
    if(salePrice($prodArray[0]['price'], $prodArray[0]['sale_price'])==FALSE){
        $view_prod->assign("TXT_PRICE",priceFormat($prodArray[0]['price']));
    } else {
        $view_prod->assign("TXT_PRICE","<span class='txtOldPrice'>".priceFormat($prodArray[0]['price'])."</span>");
        $salePrice = salePrice($prodArray[0]['price'], $prodArray[0]['sale_price']);
        $view_prod->assign("TXT_SALE_PRICE", priceFormat($salePrice));
    }
    if($prodArray[0]['useStockLevel']==1 && $prodArray[0]['stock_level']<1) {
        $view_prod->assign("TXT_PRICE","CALL!");
    }
This means that if the product is using stock levels and the stock level is less than 1, then print CALL! instead of the price.

Very similar code is in viewCat.inc.php and index.inc.php (Latest Products section).

Again, let us know if you need more detailed instructions.

Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 31st August 2014 - 08:21 AM
CubeCart Developers Network
Get CubeCart!
© 2007 - 2014  CubeCartForums.org in association with Inspired Solutions. Sponsored by Devellion