]> _ Git - cubeextranet.git/commitdiff
wip #4284 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sat, 20 Feb 2021 11:36:30 +0000 (11:36 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Sat, 20 Feb 2021 11:36:30 +0000 (11:36 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 252eb655edf5ce5d9dda94b3cb2d0418bfc301bc..fca835b2a7b3cb24d081ca625b53c02d43cc2fc9 100644 (file)
@@ -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');
index 87163a7ccfda6a3c1b8b558bc6bff72086c58508..a6b4c4e0898eae9b7e33001f8a8e93aa37ae14d0 100644 (file)
@@ -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';