Link Custom field issue

  • Posts: 70
  • Thank you received: 0
6 years 4 months ago #284030

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.1

I want to create button link in each product.
So I try to add this code in product / show_tabular

<!-- Free item button --> 
    <div id="hikashop_detail_freeitem" class="hikashop_detail_freeitem">
      <a target="_blank" href=" <?php echo $this->row->freeitemdetail; ?> "class="hikabtn">
        <?php echo JText::_('Free Item Detail'); ?>
      </a>
     </div>
and "freeitemdetail" is column name in custom field (type link) that I created.
Then I try to click my button but it show 404 not found. ( https://grammashop.com/index.php/th/shop/hikashop-menu-for-products-listing/product/asuspro-b9440uaThis link )

Can you help me?

Thanks

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
6 years 4 months ago #284041

Hi,

You should use a custom field of the type "text" in order to enter your URL if you want to display it yourself on the product page.
The "link" type has both the name and the link saved together in the database and thus if you use that data directly in your href, it won't work like you can see.

The following user(s) said Thank You: Bankthaworn

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

  • Posts: 70
  • Thank you received: 0
6 years 4 months ago #284109

Thanks Nicolas
I change it to text type but I still doesn't work.
My code is correct?

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 4 months ago #284114

Hello,

Please follow ALL of his instructions :

You should use a custom field of the type "text" in order to enter your URL

I suppose that you change the type but I also know that you did not change the content of the custom field ; so you still have some non working data as Nicolas explained you :

The "link" type has both the name and the link saved together in the database and thus if you use that data directly in your href, it won't work like you can see.

So, please read carefully messages and explanations that we're giving you.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum