Setting price to Zero and showing custom message 4.03

Hi

Can someone here help me with this as support can not understand what I want to achieve.



Currently when a product price is set to Zero this shows €0.00 on the product on the site.



I can hide the €0.00 and display a custom message by changing the “Zero price Action” and not allowing the customer to ad the product to cart.





What I want to do.



I when a product is set to €0.00 price I want to set the “Zero price Action” to “allow the customer to add to the shopping cart”



But at the same time change the €0.00 to a custom message.





The reasoning for this is that most of the product the merchants are selling are for the disability sector and require special fitting and bespoke modifications, So the price changes.



They will be paying us for each inquiry and subsequent sale made after the customer places the order.

All €0.00 Purchases will be treated and an inquiry and must be sent via the checkout.



Alan

Hi Alan,



Greetings from Chilliapple



As pe rour understanding you want to allow users to add to cart products whose price is set to 0 along with a custom message. Please confirm our understanding. Also please confirm for which version of Cs cart this feature is required.



Regards,

Vishakha

Vishakha

Thank you for your reply, yes your understanding of what I want is correct.



The version of CS Cart is 4.03





Alan

Use an override hook for the price_block if the price is 0.00.

[quote name='tbirnseth' timestamp='1384386589' post='171566']

Use an override hook for the price_block if the price is 0.00.

[/quote]Hi tbirnseth

Thanks for the info,

This in sound exactly the way I would want to achieve this, but unfortunately I am very new to CS Cart and can not find much information on exactly how to do this.

Could I please get a few pointers.



Alan

There are many posts on using hooks so I won't go into detail.

Look at the file: design/themes/basic/templates/common/product_data.tpl

Find the line that looks like {hook name=“products:prices_block”}

You will be optionally replacing the code in this block. You should cut/paste the info within this block to a notepad window or some other retrievable place.

Create a directory/file called: design/themes/basic/templates/addons/my_changes/hooks/products/prices_block.override.tpl

Make sure the 'my_changes' addon is active on your system (it is off by default now for some reason).

This file should look like:


{if $product.price|floatval == 0.00}
Your custom message
{else}
copy/paste the block from the product_data.tpl file so it all behaves as it did before here
{/if}


This is a simplistic explanation, depending on your admin settings, you might have to add more to the if statement for conditions to trigger Your custom message properly.

Clear your template cache via http://?ctpl



Good luck.

tbirnseth



Thank you every much for your valued response.

I suspect as I am new to CS Cart and the forum. I need to learn to be more clear in my questions



I did know how to work with the hooks after reading many of the posts within the forum. but your info has made it very clear.



It is the code to put in the file that completely defeats me.



I think that as hooks are such a major part of the CS Cart and no information is available in the manuals. CS should add a specific forum section just for hooks.



Alan

Hi tbirnseth

I can not express my gratitude for your help

Your solution worked first time.



Regards

Alan

Just think of a template hook as being a block of code. A 'pre' designation will put whatever is in your file ahead of that block and a 'post' designation will put whatever after that block. An 'override' is a bit different in that it will flush any previous overrides, pre or post hooks and start from scratch replacing what is in the block with whatever's in the override file.



There should be varaible that contains the hook block code passed to the underlying code. This would prevent the copy/paste and inevitable becoming out of sync with the code in the hook block.

Hi tbirnseth



I have searched many cs-cart forum posts & manual pages, but I can't find good material on hooks and addons & their working, so can you suggest me some links for that by posting it here?, It would be really helpful to me.



Thanks in advance



Vivek

You can check this out CS-Cart Documentation — CS-Cart 4.15.x documentation