Jump to content

'simple' PHP help needed! Replace OOS or $0 prod wit


Guest lprintz

Recommended Posts

Guest lprintz

Hello all!

I need help with what I believe is a simple PHP thing...I just can't seem to get the syntax right!

Ideally I'd like the 'sale price' to show 'Call for pricing' if a product is out of stock

Alternatively, I can set OOS products to $0, in which case I would need PHP to designate if the sale price is set to zero, then show 'Call for pricing'

Any assistance would be MOST appreciated!

Thanks so much!

Len

Link to comment
Share on other sites

Guest Viola

In /skins/[skin_name]/templates/content.product.php look for this:

<div id="price">

    {if $PRODUCT.ctrl_sale}

	    <span class="price_previous">{$PRODUCT.price}</span>

	    <span class="price_sale">{$PRODUCT.sale_price}</span>

    {else}

	    {$PRODUCT.price}

    {/if}

</div>




replace with





<div id="price">

    {if $PRODUCT.ctrl_sale}

	    {if $CTRL_OUT_OF_STOCK}

		    <p>Call for pricing</p>

	    {else}

		    <span class="price_previous">{$PRODUCT.price}</span>

		    <span class="price_sale">{$PRODUCT.sale_price}</span>

	    {/if}

    {else}

	    {$PRODUCT.price}

    {/if}

</div>

Haven't tested it, but it should work in theory.

Link to comment
Share on other sites

Guest lprintz

Hey Viola!

Thanks SO much and this worked great...HOWEVER...the OOS product isn't appearing on the site so I think we need to go the 'if product = 0' route. Could you help me out with the syntax on that? Basically, if the sale price is zero then show 'call for pricing'

Len

Link to comment
Share on other sites

Guest Viola

the OOS product isn't appearing on the site so I think we need to go the 'if product = 0' route. Could you help me out with the syntax on that? Basically, if the sale price is zero then show 'call for pricing'

That can't be done in the template - if the sale price is 0 then the item is not considered to be on sale. So that way would involve hacking up the source code. But if the item is not appearing on the site in the first place I'm not sure how that would help. Do you know why the item is not appearing?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...