From 59ded75c14386eb90a92f34730ac8e490d3fbe5e Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Sat, 20 Feb 2021 11:36:30 +0000 Subject: [PATCH] wip #4284 @1 --- .../html5/master/class.ws.html5.compiler.php | 24 +++++++++++++++---- .../html5/master/class.ws.html5.links.php | 18 +++++++++++++- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 252eb655e..fca835b2a 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -421,6 +421,19 @@ class wsHTML5Compiler $this->config->seoArticles = $this->seoArticles; } + public function writeGrandVisionCart(){ + $this->lessVariables['import-cart-styles'] = 'grandvision'; + + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('grandvision', 'js/libs/fluidbook/cart/fluidbook.cart.grandvision.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + + $cdir = $this->wdir . '/commerce/'; + $file = $cdir . $this->book->parametres->basketReferences; + $this->config->basketReferences = wsUtil::excelToArrayKeyVars($file); + + } + public function writeMIFCart() { $this->lessVariables['import-cart-styles'] = 'mif'; @@ -518,12 +531,13 @@ class wsHTML5Compiler { if ($this->config->basket) { $this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js'); - if ($this->config->basketManager === 'Puma') { - return $this->writePumaCart(); - } else if ($this->config->basketManager === 'MIF') { - return $this->writeMIFCart(); - } switch ($this->config->basketManager) { + case 'Puma': + return $this->writePumaCart(); + case 'MIF': + return $this->writeMIFCart(); + case 'GrandVision': + return $this->writeGrandVisionCart(); case 'Remarkable': $this->addJsLib('parsley', 'js/libs/parsley.min.js'); $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 87163a7cc..a6b4c4e08 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -127,6 +127,7 @@ class wsHTML5Link case 11: return new actionLink($id, $init, $compiler); case 12: + if ($compiler->book->parametres->basketManager === 'Puma' || $compiler->book->parametres->basketManager === 'MIF') { return new zoomProductLink($id, $init, $compiler); } @@ -134,6 +135,8 @@ class wsHTML5Link return new zoomProductLink($id, $init, $compiler); } switch ($compiler->book->parametres->basketManager) { + case 'GrandVision': + return new grandVisionCartLink($id, $init, $compiler); case 'JoueclubWishlist': return new JoueclubWishlistLink($id, $init, $compiler); case 'Remarkable': @@ -862,7 +865,7 @@ class htmlMultimediaPopupImage extends normalLink { $this->copyExternalFile($this->alternative); $read = ($this->read_mode) ? 'r_' : ''; - return '#/multimedia/' . $read . md5($this->alternative . '/' . $this->extra.'/'.$this->id); + return '#/multimedia/' . $read . md5($this->alternative . '/' . $this->extra . '/' . $this->id); } public function getAdditionnalContent() @@ -1953,6 +1956,19 @@ class audioLink extends wsHTML5Link } +class grandVisionCartLink extends normalLink +{ + public function getDefaultTooltip() + { + return 'More details'; + } + + public function getURL() + { + return '#/cart/details/' . $this->to; + } +} + class JoueclubWishlistLink extends normalLink { protected $role = 'link'; -- 2.39.5