]> _ Git - cubeextranet.git/commitdiff
wip #4447 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 12 May 2021 15:12:30 +0000 (15:12 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 12 May 2021 15:12:30 +0000 (15:12 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index b8fddce67de7b2f63b96022e7061ff78799b8bd2..5ad6d65b07a8c3682e21b1daef2077e01beb1689 100644 (file)
@@ -681,6 +681,7 @@ class wsBookParametres extends wsParametres
                 'Mopec' => 'Mopec',
                 'Puma' => 'Puma',
                 'MIF' => 'MIF',
+                'Flexipan' => 'Flexipan',
                 'Zoom + lien produit (déprécié, utiliser la fonctionnalité "Zoom produits")' => 'ZoomProductLink',
                 'Wishlist Jouéclub' => 'JoueclubWishlist',
                 'GrandVision' => 'GrandVision',
index bc5a1ad02b41d410c3501166c3589bd5674b3c72..c491ee1fcdd4eb4cb136c29ae9919e03a53e659d 100644 (file)
@@ -518,6 +518,34 @@ class wsHTML5Compiler
         return false;
     }
 
+    public function writeFlexipanCart()
+    {
+        $this->lessVariables['import-cart-styles'] = 'flexipan';
+
+        $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js');
+        $this->addJsLib('flexipan', 'js/libs/fluidbook/cart/fluidbook.cart.flexipan.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);
+
+        wsLinks::getLinksAndRulersFromFile($this->book_id, $links, $rulers);
+
+        foreach ($links as $link) {
+            if ($link['type'] == '12') {
+
+            }
+        }
+
+        $this->config->product_zoom_references = [];
+        foreach ($this->config->basketReferences as $ref => $data)
+            $this->config->product_zoom_references[$ref] = [$ref];
+        }
+    }
+
     public function writeMIFCart()
     {
         $this->lessVariables['import-cart-styles'] = 'mif';
@@ -618,6 +646,8 @@ class wsHTML5Compiler
         if ($this->config->basket) {
             $this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js');
             switch ($this->config->basketManager) {
+                case 'Flexipan';
+                    return $this->writeFlexipanCart();
                 case 'Puma':
                     return $this->writePumaCart();
                 case 'MIF':
index 953e62ef08358faafd5baecb6025ab85ed78ee1e..3304ff036658e493e94fba4b96136b748c2945c4 100644 (file)
@@ -131,7 +131,7 @@ class wsHTML5Link
                 return new actionLink($id, $init, $compiler);
             case 12:
 
-                if ($compiler->book->parametres->basketManager === 'Puma' || $compiler->book->parametres->basketManager === 'MIF') {
+                if ($compiler->book->parametres->basketManager === 'Puma' || $compiler->book->parametres->basketManager === 'MIF' || $compiler->book->parametres->basketManager === 'Flexipan') {
                     return new zoomProductLink($id, $init, $compiler);
                 }
                 if ($compiler->book->parametres->product_zoom_references !== '') {
@@ -1812,28 +1812,28 @@ class htmlMultimediaLink extends wsHTML5Link
         return $this->_content;
     }
 
-    public function getLottieContent($c, $width, $height)
-    {
-        $this->_config = ['width' => $this->width * $this->getCssScale(), 'height' => $this->height * $this->getCssScale()];
-        $parsedLottie = self::_parseLottieContent($c);
-
-        $lottieID = $this->compiler->addLottie($parsedLottie['animation'], $parsedLottie['params'], $parsedLottie['hash']);
-        return '<div class="lottie" data-lottie-id="' . $lottieID . '"></div>';
-    }
-
-    public static function _parseLottieContent($c)
-    {
-        $hash = hash('sha256', $c);
-        $start = mb_strpos($c, 'var animationData = {') + 20;
-        $end = mb_strpos($c, '};', $start) + 1;
-        $ad = mb_substr($c, $start, $end - $start);
-        $animationData = json_decode($ad);
-        preg_match('/var params = (\{.*\});/sU', $c, $matches);
-        $matches[1] = str_replace('container: document.getElementById(\'lottie\'),', '', $matches[1]);
-        $matches[1] = str_replace('animationData: animationData', '', $matches[1]);
-        $params = CJSON::decode($matches[1]);
-        return ['animation' => $animationData, 'params' => $params, 'hash' => $hash];
-    }
+//    public function getLottieContent($c, $width, $height)
+//    {
+//        $this->_config = ['width' => $this->width * $this->getCssScale(), 'height' => $this->height * $this->getCssScale()];
+//        $parsedLottie = self::_parseLottieContent($c);
+//
+//        $lottieID = $this->compiler->addLottie($parsedLottie['animation'], $parsedLottie['params'], $parsedLottie['hash']);
+//        return '<div class="lottie" data-lottie-id="' . $lottieID . '"></div>';
+//    }
+//
+//    public static function _parseLottieContent($c)
+//    {
+//        $hash = hash('sha256', $c);
+//        $start = mb_strpos($c, 'var animationData = {') + 20;
+//        $end = mb_strpos($c, '};', $start) + 1;
+//        $ad = mb_substr($c, $start, $end - $start);
+//        $animationData = json_decode($ad);
+//        preg_match('/var params = (\{.*\});/sU', $c, $matches);
+//        $matches[1] = str_replace('container: document.getElementById(\'lottie\'),', '', $matches[1]);
+//        $matches[1] = str_replace('animationData: animationData', '', $matches[1]);
+//        $params = CJSON::decode($matches[1]);
+//        return ['animation' => $animationData, 'params' => $params, 'hash' => $hash];
+//    }
 
     public function getHTMLContainerClass()
     {