Paid for file creating BR and leaving gap on product page

  • Posts: 27
  • Thank you received: 1
8 years 6 months ago #257514

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.4.45-0+deb7u5
-- Browser(s) name and version -- : Chrome 54.0.2840.99

I have a product which has 12 paid for files and one free file. On the product page in the downloads section, it does not show the paid for items but inserts a BR tag for each one leading to a large gap on the page.

1st attached picture is a screen shot of the our page with showing inspect screen with 12 BR tags after the file.

2nd attached picture is the section of code causing the BR tags to appear. If removed then all files appear on the same line.

Can this be moved so that the BR tags are only shown when the file is available to download.


If you need any more information, please let me know
Thanks mike

Attachments:

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257516

Hi,

Nice catch. Thanks for the feedback !
Change the foreach code to:

foreach ($this->element->files as $file) {
				if (empty ($file->file_name)) {
					$file->file_name = $file->file_path;
				}
				if (empty ($file->file_free_download))
					continue;
				$html[] = '<a class="hikashop_product_file_link" href="' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id.$url_itemid) . '">' . $file->file_name . '</a><br/>';
			}
and it will fix that.

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

  • Posts: 27
  • Thank you received: 1
8 years 6 months ago #257608

That worked but I had to remove the the <br/> at the end of line 35, otherwise I would get to BR tags between two free downloads links

35 $html[] = '<a class="hikashop_product_file_link" href="' . hikashop_completeLink('product&task=download&file_id=' . $file->file_id.$url_itemid) . '">' . $file->file_name . '</a>';

Thanks for the help

Mike

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

  • Posts: 83993
  • Thank you received: 13605
  • MODERATOR
8 years 6 months ago #257614

Hi,

Ah yes, thanks ! We'll fix that too.

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

Time to create page: 0.038 seconds
Powered by Kunena Forum