Use a custom field in price listing

  • Posts: 19
  • Thank you received: 0
11 years 10 months ago #84178

Hello!

I've been working at this for a few days with absolutely no luck and would greatly appreciate any help.

I have created a custom field in the Products table where I can list the unit of measure [UOM] for each item, PC, SET, etc. Instead of having this field appear under SPECIFICATIONS on the product page I would like to use the field in line with the price under the product image. I also would like to incorporate it into the product listing page to read "As Low as $40.00 per SET. Please see the attached images for a better understanding.

Thanks! I love Hikashop and this forum has helped me a ton in developing my store. Have a great day!

Jeff

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 0
11 years 10 months ago #84261

Hello,

I did manage to get the custom field "salemethod" to appear on the product page for the highest price by using this: www.hikashop.com/en/support/documentation/faq.html#each

I still need to get the salemethod field to show with the rest of the fields. If anyone could point me in the right direction it'd be great.

Thanks!
Jeff

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84400

Hi,

You will have to edit the view "product / listing_price" and add a condition around: "echo JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity);" and "echo JText::_('PER_UNIT');" to change the text depending of the type of product. If the product is a set so change the translation to set it a "per set ..." etc.

For the text in the products listing it's in the same file.

It require some PHP knowledge to do that.

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 0
11 years 10 months ago #84649

Thanks once again Xavier! My PHP knowledge is minimal at best. Could you provide me with a code snippet sample that I can play with?

This shop is my second installation of Hikashop Business. The first one was for a client and I liked it so much I bought it for my own business. I guess it's a good thing for my clients application it didn't take much customizing!

Again, I appreciate your time. Have a great day!

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #84708

You can use something like:

					if($this->row->salemethod == "set"){
						echo JText::_('PER_SET');
					}else{
						echo JText::_('PER_UNIT');
					}

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum