Plugin Directory

Changeset 3256919


Ignore:
Timestamp:
03/17/2025 07:26:28 AM (11 months ago)
Author:
troll_winner
Message:

1.0.2

Location:
products-wizard-lite-for-woocommerce/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • products-wizard-lite-for-woocommerce/trunk/includes/classes/Cart.php

    r3252167 r3256919  
    1010 *
    1111 * @class Cart
    12  * @version 9.1.0
     12 * @version 9.1.1
    1313 */
    1414class Cart
     
    283283
    284284        return apply_filters('wcpw_cart_categories_ids', $output, $wizardId, $args);
    285     }
    286 
    287     /**
    288      * Get cart products attribute values
    289      *
    290      * @param integer $wizardId
    291      * @param string $attribute
    292      * @param array $args
    293      *
    294      * @return array
    295      */
    296     public static function getAttributeValues($wizardId, $attribute, $args = [])
    297     {
    298         $output = [];
    299 
    300         // unified workflow
    301         if (substr($attribute, 0, strlen('pa_')) == 'pa_') {
    302             $attribute = substr($attribute, strlen('pa_'));
    303         }
    304 
    305         foreach (self::get($wizardId, $args) as $cartItem) {
    306             if (!isset($cartItem['product_id'])) {
    307                 continue;
    308             }
    309 
    310             if (!empty($cartItem['variation_id'])
    311                 && ($variation = wc_get_product($cartItem['variation_id'])) && !empty($variation)
    312                 && ($variationAttribute = $variation->get_attribute($attribute)) && !empty($variationAttribute)
    313                 && ($variationTerm = DataBase\Term::get($variationAttribute, "pa_$attribute", 'name')) && !empty($variationTerm)
    314             ) {
    315                 // try to define specific variation attribute value
    316                 $output[] = $variationTerm->term_id;
    317             } else {
    318                 // just get all product attribute values
    319                 $output = array_merge(
    320                     $output,
    321                     Product::getTermsIds($cartItem['product_id'], ['taxonomy' => "pa_$attribute", 'all' => false])
    322                 );
    323             }
    324         }
    325 
    326         $output = array_unique($output);
    327 
    328         return apply_filters('wcpw_cart_attribute_values', $output, $wizardId, $attribute, $args);
    329285    }
    330286
  • products-wizard-lite-for-woocommerce/trunk/includes/classes/Core.php

    r3252167 r3256919  
    66 *
    77 * @class Core
    8  * @version 13.1.0
     8 * @version 13.1.1
    99 */
    1010class Core
     
    136136
    137137        foreach ($requiredClasses as $requiredClass) {
    138             if (!class_exists('\\WCProductsWizard\\' . $requiredClass)
     138            if (!class_exists(__NAMESPACE__ . $requiredClass)
    139139                && file_exists(__DIR__ . DIRECTORY_SEPARATOR . $requiredClass . '.php')
    140140            ) {
  • products-wizard-lite-for-woocommerce/trunk/includes/classes/Form.php

    r3252167 r3256919  
    22namespace WCProductsWizard;
    33
    4 use Exception;
    54use WCProductsWizard\Entities\Product;
    65use WCProductsWizard\Entities\Wizard;
     
    1110 *
    1211 * @class Form
    13  * @version 8.5.0
     12 * @version 8.5.1
    1413 */
    1514class Form
     
    150149                    self::requestStep($request);
    151150                }
    152             } catch (Exception $exception) {
     151            } catch (\Exception $exception) {
    153152                $this->addNotice(
    154153                    $exception->getCode() ?: self::getActiveStepId($request['id']),
     
    195194     * Add error notice and reply with the form HTML
    196195     *
    197      * @param Exception $exception
     196     * @param \Exception $exception
    198197     * @param array $postData
    199198     * @param string $view - view template to output
     
    332331     * @param string $stepId
    333332     *
    334      * @throws Exception
     333     * @throws \Exception
    335334     */
    336335    public static function checkStepRules($args, $stepId)
     
    377376                    $message = Wizard::getMinimumProductsSelectedMessage($args['id'], $value, $selectedCount);
    378377
    379                     throw new Exception(wp_kses_post($message), (int) $stepId);
     378                    throw new \Exception(wp_kses_post($message), (int) $stepId);
    380379                }
    381380            }
     
    392391                    $message = Wizard::getMaximumProductsSelectedMessage($args['id'], $value, $selectedCount);
    393392
    394                     throw new Exception(wp_kses_post($message), (int) $stepId);
     393                    throw new \Exception(wp_kses_post($message), (int) $stepId);
    395394                }
    396395            }
     
    407406                    $message = Wizard::getMinimumProductsSelectedMessage($args['id'], $value, $totalQuantity);
    408407
    409                     throw new Exception(wp_kses_post($message), (int) $stepId);
     408                    throw new \Exception(wp_kses_post($message), (int) $stepId);
    410409                }
    411410            }
     
    422421                    $message = Wizard::getMaximumProductsSelectedMessage($args['id'], $value, $totalQuantity);
    423422
    424                     throw new Exception(wp_kses_post($message), (int) $stepId);
     423                    throw new \Exception(wp_kses_post($message), (int) $stepId);
    425424                }
    426425            }
     
    433432     * @param array $args
    434433     *
    435      * @throws Exception
     434     * @throws \Exception
    436435     */
    437436    public static function checkNonce($args = [])
     
    445444
    446445        if (empty($args['nonce']) || !wp_verify_nonce($args['nonce'], 'wcpw')) {
    447             throw new Exception(wp_kses_post('Nonce error. Please, try to refresh the page.'), (int) $args['step_id']);
     446            throw new \Exception(wp_kses_post('Nonce error. Please, try to refresh the page.'), (int) $args['step_id']);
    448447        }
    449448    }
     
    455454     * @param array $cart
    456455     *
    457      * @throws Exception
     456     * @throws \Exception
    458457     */
    459458    public static function checkCartRules($args, $cart)
     
    493492            $message = Wizard::getMinimumProductsSelectedMessage($id, $limit, $productsSelectedCount);
    494493
    495             throw new Exception(wp_kses_post($message));
     494            throw new \Exception(wp_kses_post($message));
    496495        }
    497496
     
    502501            $message = Wizard::getMaximumProductsSelectedMessage($id, $limit, $productsSelectedCount);
    503502
    504             throw new Exception(wp_kses_post($message));
     503            throw new \Exception(wp_kses_post($message));
    505504        }
    506505
     
    511510            $message = Wizard::getMinimumProductsSelectedMessage($id, $limit, $totalProductsQuantity);
    512511
    513             throw new Exception(wp_kses_post($message));
     512            throw new \Exception(wp_kses_post($message));
    514513        }
    515514
     
    520519            $message = Wizard::getMaximumProductsSelectedMessage($id, $limit, $totalProductsQuantity);
    521520
    522             throw new Exception(wp_kses_post($message));
     521            throw new \Exception(wp_kses_post($message));
    523522        }
    524523    }
     
    570569     * @return boolean
    571570     *
    572      * @throws Exception
     571     * @throws \Exception
    573572     */
    574573    public static function submit($args)
     
    740739
    741740                    Cart::addProduct($args['id'], apply_filters('wcpw_submit_form_item_data', $data, $args));
    742                 } catch (Exception $exception) {
    743                     throw new Exception(wp_kses_post($exception->getMessage()), (int) $data['step_id']);
     741                } catch (\Exception $exception) {
     742                    throw new \Exception(wp_kses_post($exception->getMessage()), (int) $data['step_id']);
    744743                }
    745744            }
     
    770769            self::submit($postData);
    771770            $this->ajaxReplyHandler($postData);
    772         } catch (Exception $exception) {
     771        } catch (\Exception $exception) {
    773772            $this->ajaxErrorHandler($exception, $postData);
    774773        }
     
    782781     * @return array - products added with keys
    783782     *
    784      * @throws Exception
     783     * @throws \Exception
    785784     */
    786785    public static function addToMainCart($args)
     
    975974
    976975                        foreach (wc_get_notices('error') as $notice) {
    977                             throw new Exception(get_the_title($productData['product_id']) . ': ' . $notice['notice']);
     976                            throw new \Exception(get_the_title($productData['product_id']) . ': ' . $notice['notice']);
    978977                        }
    979978                    }
    980                 } catch (Exception $exception) {
     979                } catch (\Exception $exception) {
    981980                    // drop all added products in case of exception
    982981                    foreach (array_keys($output) as $outputKey) {
     
    984983                    }
    985984
    986                     throw new Exception(wp_kses_post($exception->getMessage()));
     985                    throw new \Exception(wp_kses_post($exception->getMessage()));
    987986                }
    988987            }
     
    10171016                ]
    10181017            );
    1019         } catch (Exception $exception) {
     1018        } catch (\Exception $exception) {
    10201019            $this->ajaxErrorHandler($exception, $postData);
    10211020        }
     
    10271026     * @param array $args
    10281027     *
    1029      * @throws Exception
     1028     * @throws \Exception
    10301029     */
    10311030    public static function requestStep($args)
     
    10751074            self::requestStep($postData);
    10761075            $this->ajaxReplyHandler($postData);
    1077         } catch (Exception $exception) {
     1076        } catch (\Exception $exception) {
    10781077            $this->ajaxErrorHandler($exception, $postData);
    10791078        }
     
    10881087            self::requestStep($postData);
    10891088            $this->ajaxReplyHandler($postData, [], 'body/step/index');
    1090         } catch (Exception $exception) {
     1089        } catch (\Exception $exception) {
    10911090            $this->ajaxErrorHandler($exception, $postData);
    10921091        }
     
    10981097     * @param array $args
    10991098     *
    1100      * @throws Exception
     1099     * @throws \Exception
    11011100     */
    11021101    public static function skipStep($args)
     
    11201119            self::skipStep($postData);
    11211120            $this->ajaxReplyHandler($postData);
    1122         } catch (Exception $exception) {
     1121        } catch (\Exception $exception) {
    11231122            $this->ajaxErrorHandler($exception, $postData);
    11241123        }
     
    11301129     * @param array $args
    11311130     *
    1132      * @throws Exception
     1131     * @throws \Exception
    11331132     */
    11341133    public static function submitAndSkipAll($args)
     
    11571156            self::submitAndSkipAll($postData);
    11581157            $this->ajaxReplyHandler($postData);
    1159         } catch (Exception $exception) {
     1158        } catch (\Exception $exception) {
    11601159            $this->ajaxErrorHandler($exception, $postData);
    11611160        }
     
    11671166     * @param array $args
    11681167     *
    1169      * @throws Exception
     1168     * @throws \Exception
    11701169     */
    11711170    public static function skipAll($args)
     
    11911190            self::skipAll($postData);
    11921191            $this->ajaxReplyHandler($postData);
    1193         } catch (Exception $exception) {
     1192        } catch (\Exception $exception) {
    11941193            $this->ajaxErrorHandler($exception, $postData);
    11951194        }
     
    12011200     * @param array $args
    12021201     *
    1203      * @throws Exception
     1202     * @throws \Exception
    12041203     */
    12051204    public static function reset($args)
     
    12281227            self::reset($postData);
    12291228            $this->ajaxReplyHandler($postData);
    1230         } catch (Exception $exception) {
     1229        } catch (\Exception $exception) {
    12311230            $this->ajaxErrorHandler($exception, $postData);
    12321231        }
     
    12421241     * @return boolean|array
    12431242     *
    1244      * @throws Exception
     1243     * @throws \Exception
    12451244     */
    12461245    public static function addCartProduct($args)
     
    12861285     * Add product to the cart via ajax
    12871286     *
    1288      * @throws Exception
     1287     * @throws \Exception
    12891288     */
    12901289    public function addCartProductAjax()
     
    12951294            self::addCartProduct($postData);
    12961295            $this->ajaxReplyHandler($postData);
    1297         } catch (Exception $exception) {
     1296        } catch (\Exception $exception) {
    12981297            $this->ajaxErrorHandler($exception, $postData);
    12991298        }
     
    13051304     * @param array $args
    13061305     *
    1307      * @throws Exception
     1306     * @throws \Exception
    13081307     */
    13091308    public static function removeCartProduct($args)
     
    13551354            self::removeCartProduct($postData);
    13561355            $this->ajaxReplyHandler($postData);
    1357         } catch (Exception $exception) {
     1356        } catch (\Exception $exception) {
    13581357            $this->ajaxErrorHandler($exception, $postData);
    13591358        }
     
    13671366     * @return boolean
    13681367     *
    1369      * @throws Exception
     1368     * @throws \Exception
    13701369     */
    13711370    public static function updateCartProduct($args)
     
    13951394            self::updateCartProduct($postData);
    13961395            $this->ajaxReplyHandler($postData);
    1397         } catch (Exception $exception) {
     1396        } catch (\Exception $exception) {
    13981397            $this->ajaxErrorHandler($exception, $postData);
    13991398        }
  • products-wizard-lite-for-woocommerce/trunk/includes/classes/Traits/Settings.php

    r3251255 r3256919  
    22namespace WCProductsWizard\Traits;
    33
    4 use WCProductsWizard\DataBase;
    54use WCProductsWizard\Utils;
    65
     
    87 * Entity with settings trait
    98 *
    10  * @version 1.0.0
     9 * @version 1.0.1
    1110 *
    1211 * @property string $namespace
  • products-wizard-lite-for-woocommerce/trunk/products-wizard-lite-for-woocommerce.php

    r3251255 r3256919  
    33 * Plugin Name: Products Wizard Lite for WooCommerce
    44 * Description: This plugin helps you sell your WooCommerce products by the step-by-step wizard
    5  * Version: 1.0.1
     5 * Version: 1.0.2
    66 * Author: [email protected]
    77 * Author URI: https://troll-winner.com/
     
    2525
    2626    if (!defined('WC_PRODUCTS_WIZARD_VERSION')) {
    27         define('WC_PRODUCTS_WIZARD_VERSION', '1.0.1');
     27        define('WC_PRODUCTS_WIZARD_VERSION', '1.0.2');
    2828    }
    2929
  • products-wizard-lite-for-woocommerce/trunk/readme.txt

    r3252167 r3256919  
    77WC requires at least: 2.4
    88WC tested up to: 9.5.2
    9 Stable tag: 1.0.1
     9Stable tag: 1.0.2
    1010License: GPLv3 or later
    1111License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    3636### Use-cases for Your Shop
    3737
    38 * Gift boxes
    39 * Software bundles
    40 * Personalized dishes
    41 * Customized services
    42 * Furniture configuration
    43 * Custom technics or mechanisms
     38* 🎁 Gift boxes
     39* 🖥️ Software bundles
     40* 🍲 Personalized dishes
     41* 🛎️ Customized services
     42* 🛋️ Furniture configuration
     43* 🧰 Custom technics or mechanisms
    4444
    4545### Go PRO
     
    4747Love products wizard, but want much more features and possibilities? Such as:
    4848
    49 * More work modes and views
    50 * Creating order PDF
    51 * Custom input fields
    52 * Inner checkout step
    53 * Flexible discount rules
    54 * More powerful Min/Max product rules
    55 * More powerful availability rules
    56 * Pre-defined wizard state and products in cart
    57 * Thumbnail image generation
    58 * Attaching to a product page
     49* 🛠 More work modes and views
     50* 🖹 Creating order PDF
     51* 📎 Custom input fields
     52* 💳 Inner checkout step
     53* 🛍️ Flexible discount rules
     54* 🛒 More powerful Min/Max product rules
     55* ↪️ More powerful availability rules
     56* 📦 Pre-defined wizard state and products in cart
     57* 🖼️ Thumbnail image generation
     58* 📌 Attaching to a product page
    5959
    6060Don't hesitate to try the full PRO version of the plugin!
     
    6464### Technical Features
    6565
    66 Full Asynchronous Workflow
     66🔃 Full Asynchronous Workflow
    6767: No excess page refreshes while using the wizard.
    6868
    69 Responsive Design
     69📱 Responsive Design
    7070: Fits any device screen size.
    7171
    72 Completely Internationalized
    73 : Translate any text string from the admin part. Also, plugin will output elements correctly for any language and writing direction.
     72🌐 Completely Internationalized
     73: Translate any text string from the admin part. Plugin outputs elements correctly for any language and writing direction.
    7474
    75 Accessibility Friendly
     75Accessibility Friendly
    7676: Works comfortable for any type of devices and manipulators.
    7777
    78 High-organized And Customizable Code
     78💻 High-organized And Customizable Code
    7979: Expand the wizard functionality with your own keeping the plugin pure and updatable.
    8080
    81 Easy Templates Customization
     81😎 Easy Templates Customization
    8282: Customize the wizard HTML parts with no headache via the admin part.
    8383
    84 Adopts Bootstrap-based Themes
     84🇧 Adopts Bootstrap-based Themes
    8585: The wizard can use your bootstrap-based theme style to be better integrated into your site.
    8686
    87 Modern JavaScript Code
    88 : Clear ES6 modules code for development and bundled one for production.
     87Modern JavaScript Code
     88: Clear and reliable code without 3rd-party dependencies.
    8989
    90 Works Without Javascript Even
     90🦖 Works Without Javascript Even
    9191: The wizard uses fail-safe technologies to work in any environment and situation.
    9292
    93 No AI/GMO code
     93🍀 No AI/GMO code
    9494: All plugin code is carefully made by hand and not by accident.
    9595
     
    118118== Changelog ==
    119119
     120= 1.0.2 =
     121Fix: Lost classes bug
     122
    120123= 1.0.1 =
    121124Tweak: Code refactoring
Note: See TracChangeset for help on using the changeset viewer.