Move Custom Product Field

  • Posts: 26
  • Thank you received: 0
5 years 9 months ago #295554

-- url of the page with the problem -- : www.airdiffusion.com.au
-- HikaShop version -- : HikaShop Business: 3.5.0
-- Joomla version -- : Joomla! 3.8.10
-- Browser(s) name and version -- : Chrome

Hi,

I would like to limit the Retail Price to specific ACL (user groups), so it is only visible if a discount is applied to a specific user group.

My current solution to this is to create a new custom product field titled "Retail Price (inc GST)" and set this to specific categories and user groups. The issue is I would like to move its position from under the "Specifications" tab to above the current price.

I have been successful in moving the field by adding the code below, but when I do this I lose the ACL settings and it is visible in all categories. Is there more code I need to add around the current code below?:

<?php echo 'RRP (INC GST): '.$this->row->rrp_heating; ?>



Attachments:

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

  • Posts: 4508
  • Thank you received: 610
  • MODERATOR
5 years 9 months ago #295567

Hello,

That will be better if you simply move the "show_block_custom_item" block rather than your command, but that means that you have to create an Item custom field and not a product custom field.
Like this you won't loose custom field parameters and especially your Acl.

Hope this will help you to move forward.
Regards

Last edit: 5 years 9 months ago by Philip.

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

  • Posts: 26
  • Thank you received: 0
5 years 8 months ago #295608

Hi,

Thanks for the response.

I tried creating a custom ITEM field as you suggested, but this functions slightly differently to the custom PRODUCT field.

Currently the custom PRODUCT field is set to allow admin to add a retails price in the backend of the product that then displays a price on the front end.




Setting this up using a custom ITEM field adds a text box to the front end of the product that customers can add content to, which is not how I would like this field displayed.


I have included some more images to illustrate the issue.

My apologies if I have misunderstood the setup of the ITEM field.

thanks,

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 8 months ago #295622

Hi,

Instead of the code:

<?php echo 'RRP (INC GST): '.$this->row->rrp_heating; ?>
you need to do:
<?php if(!empty($this->fields['rrp_heating'])) echo 'RRP (INC GST): '.$this->row->rrp_heating; ?>

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

  • Posts: 26
  • Thank you received: 0
5 years 8 months ago #295667

Hi,

Thanks Nicolas, that code seems to have done the trick!

I added it to "listing_price.php" and it seems to load in the custom field and is following the ACL and category restrictions applied to the field too.

Thanks for your assistance!

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

Time to create page: 0.092 seconds
Powered by Kunena Forum