• Priority: 0
  • Status: Closed
  • Theme: Venedor
  • Assigned To: No-one
  • Private: No
  • Open Date: 27.01.17, 13:37
  • Opened by: Alex
  • Closed by: Marek
  • Closed on: 05.08.17, 18:50
  • Reason: Closed
  • Comment: Glad to help!

Ticket #10188 - ven2.3 flexmenu no product name if disabled price

If price disabled (catalog mode) no product name

FIX:
file \modules\pk_flexmenu\pk_flexmenu.php line 1157

if ($product->show_price && !(bool)$pscatmode){
		$this->_menu .= '<span class="price">'.( !$priceDisplay ? Tools::displayPrice(Tools::ps_round($product->price*(0.01*$product->tax_rate)+$product->price, 2)) : Tools::displayPrice(Tools::ps_round($product->price, 2))).'</span>'.(($reduction) ? ' <span class="old_price">'.Tools::displayPrice($product->getPriceWithoutReduct(false)).'</span>' : '').'<a href="'.htmlentities($product->getLink()).'" class="menu-product-name">'.$nm.'</a></li>'.PHP_EOL;}

change to

$this->_menu .= '<a href="'.htmlentities($product->getLink()).'" class="menu-product-name">'.$nm.'</a>';
			if ($product->show_price && !(bool)$pscatmode){
				$this->_menu .= '<span class="price-container'.(($reduction) ? " reduction" : "").'"><span class="price">'.( !$priceDisplay ? Tools::displayPrice(Tools::ps_round($product->price*(0.01*$product->tax_rate)+$product->price, 2)) : Tools::displayPrice(Tools::ps_round($product->price, 2))).'</span>'.(($reduction) ? ' <span class="old_price">'.Tools::displayPrice($product->getPriceWithoutReduct(false)).'</span>' : '').'</span>'.PHP_EOL;}

Comments

Manuel García 30 Jan 2017, 16:41

I have in line 1335 (not 1157):

			if ($product->show_price && !(bool)$pscatmode){
				$this->_menu .= '<span class="price-container'.(($reduction) ? " reduction" : "").'"><span class="price">'.( !$priceDisplay ? Tools::displayPrice(Tools::ps_round($product->price*(0.01*$product->tax_rate)+$product->price, 2)) : Tools::displayPrice(Tools::ps_round($product->price, 2))).'</span>'.(($reduction) ? ' <span class="old_price">'.Tools::displayPrice($product->getPriceWithoutReduct(false)).'</span>' : '').'</span>'.PHP_EOL;}

The code is not exactly the same (flexmenu 1.4.7). I have edited the file with the code you suggested and now it duplicates names :_(

Alex 30 Jan 2017, 17:21

Yes of course because I already fixed for you and you don’t need to do nothing. I wrote that in your ticket.
:D

Please rollback your changes and check. It works ok

Manuel García 30 Jan 2017, 17:45

Hahahaha, sorry, I misunderstood you. I did think you fixed it in your master branch, not directly in my code. I rolled it back and works ok, thanks :-)

PS: it is very difficult to show the product name in 2 lines so it doesn’t cut the name so short?

Alex 30 Jan 2017, 19:17

If you want to see more title characters you can increase this value https://www.screencast.com/t/C1YGWspJ3b
file \modules\pk_flexmenu\pk_flexmenu.php