Plugin Directory

Changeset 2900195


Ignore:
Timestamp:
04/17/2023 01:17:09 PM (3 years ago)
Author:
expivi
Message:

2.7.6 2023/04/17

  • Fixed: Fixed 'Camera position' and 'Show progress' setting in product settings.
  • New: Configured product details are now shown in Save My Design mails.
Location:
expivi/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • expivi/trunk/classes/class-expivi.php

    r2897250 r2900195  
    2929     * @var string
    3030     */
    31     public $version = '2.7.5';
     31    public $version = '2.7.6';
    3232
    3333    /**
  • expivi/trunk/classes/connect-rep/class-expivi-save-design-rep-email-builder.php

    r2714461 r2900195  
    7070     */
    7171    public function __construct( array $data ) {
    72         $this->configuration = $data['configuration'];
     72        $this->configuration = json_decode( $data['configuration'], true );
    7373        $this->user_data     = $data['user_data'];
    7474        $this->permalink     = $data['permalink'];
     
    102102                        'emails/connect-rep/email_connect_rep_content.phtml',
    103103                        array(
    104                             'share_link' => $this->share_link,
    105                             'user_data'  => $this->user_data,
     104                            'share_link'    => $this->share_link,
     105                            'user_data'     => $this->user_data,
     106                            'shop_name'     => get_bloginfo( 'name' ),
     107                            'configuration' => $this->configuration,
    106108                        )
    107109                    ),
  • expivi/trunk/classes/core/loggers/class-expivi-logger-bugsnag.php

    r2680809 r2900195  
    4343        try {
    4444            $this->bugsnag = Bugsnag\Client::make( '985b561a3ca9a598cdeea732e3e2f6c6' );
     45            $this->bugsnag->setAppVersion( XPV()->version );
     46            $this->bugsnag->setReleaseStage( 'production' );
    4547            // Note: Do not register Bugsnag handler as it will capture all exceptions on website.
    4648            $this->enabled = true;
  • expivi/trunk/classes/helpers/class-expivi-configuration-helper.php

    r2892766 r2900195  
    1313     * Retrieves the configuration hash from the configuration object
    1414     *
    15      * @param Mixed $configuration The configuration array.
     15     * @param mixed $configuration The configuration array.
    1616     *
    1717     * @return string
    1818     */
    19     public function get_configuration_hash( $configuration ) {
     19    public function get_configuration_hash( $configuration ): string {
    2020        $configuration_unslashed = wp_unslash( $configuration );
    2121        $configured_products     = json_decode( $configuration_unslashed, true );
     
    2727     * Retrieves and creates the configuration share link.
    2828     *
    29      * @param Mixed  $configuration The configuration array.
     29     * @param mixed  $configuration The configuration array.
    3030     * @param mixed  $permalink The base url from the request.
    3131     * @param string $directory Fixed set upload directory.
    3232     * @return string
    3333     */
    34     public function get_share_link_url( $configuration, $permalink, $directory ) {
     34    public function get_share_link_url( $configuration, $permalink, string $directory ): string {
    3535        $hash     = $this->get_configuration_hash( $configuration );
    3636        $sub_dir  = XPV()->fs->combine( $directory, $hash );
     
    8888     * @return string
    8989     */
    90     private function get_config_hash( $configured_product, int $price, array $meta_data = array() ) {
     90    private function get_config_hash( $configured_product, int $price, array $meta_data = array() ): string {
    9191        $arr = array(
    9292            'articles' => $configured_product['articles'],
  • expivi/trunk/classes/save-design/class-expivi-save-design-controller.php

    r2837427 r2900195  
    5555
    5656            if ( ! empty( $_POST['configuration'] ) ) {
    57                 $configuration = sanitize_text_field( wp_unslash( $_POST['configuration'] ) );
     57                $configuration = stripslashes( $_POST['configuration'] );
    5858            }
    5959
     
    122122     * Process save-design form.
    123123     *
    124      * @throws Exception Throws an exception when the form cannot be build.
     124     * @throws Exception Throws an exception when the form cannot be built.
    125125     */
    126126    public function process_form(): void {
  • expivi/trunk/classes/save-design/class-expivi-save-design-email-builder.php

    r2714461 r2900195  
    6262     */
    6363    public function __construct( array $data ) {
    64         $this->configuration = $data['configuration'];
     64        $this->configuration = json_decode( $data['configuration'], true );
    6565        $this->user_data     = $data['user_data'];
    6666        $this->permalink     = $data['permalink'];
     
    103103                        'emails/save-design/email_save_design_content.phtml',
    104104                        array(
    105                             'share_link' => $this->share_link,
    106                             'user_data'  => $this->user_data,
    107                             'shop_name'  => get_bloginfo( 'name' ),
     105                            'share_link'    => $this->share_link,
     106                            'user_data'     => $this->user_data,
     107                            'shop_name'     => get_bloginfo( 'name' ),
     108                            'configuration' => $this->configuration,
    108109                        )
    109110                    ),
  • expivi/trunk/classes/woocommerce/admin/class-expivi-admin-product-settings.php

    r2825298 r2900195  
    111111            $hide_price_when_zero      = $product->meta_exists( 'xpv_hide_price_when_zero' ) && $product->get_meta( 'xpv_hide_price_when_zero' );
    112112            $enable_pdf_download       = $product->meta_exists( 'xpv_enable_pdf_download' ) && $product->get_meta( 'xpv_enable_pdf_download' );
    113             $camera_position_thumbnail = $product->meta_exists( 'xpv_camera_position_thumbnail' ) ? (int) $product->get_meta( 'camera_position_thumbnail' ) : 0;
     113            $camera_position_thumbnail = $product->meta_exists( 'xpv_camera_position_thumbnail' ) ? (int) $product->get_meta( 'xpv_camera_position_thumbnail' ) : 0;
    114114            $price_layout              = $product->meta_exists( 'xpv_price_layout' ) ? (int) $product->get_meta( 'xpv_price_layout' ) : 0;
    115115            $pdf_orientation           = $product->meta_exists( 'xpv_pdf_orientation' ) ? $product->get_meta( 'xpv_pdf_orientation' ) : 'portrait';
     
    228228        }
    229229
     230        if ( array_key_exists( 'xpv_show_progress', $_POST ) && true === (bool) $_POST['xpv_show_progress'] ) {
     231            update_post_meta( $product_id, 'xpv_show_progress', '1' );
     232        } else {
     233            update_post_meta( $product_id, 'xpv_show_progress', '0' );
     234        }
     235
    230236        if ( array_key_exists(
    231237            'xpv_camera_position_thumbnail',
     
    237243                sanitize_text_field( wp_unslash( $_POST['xpv_camera_position_thumbnail'] ) )
    238244            );
    239         } else {
    240             update_post_meta( $product_id, 'xpv_show_progress', '0' );
    241         }
    242 
    243         if ( array_key_exists(
    244             'xpv_hide_price_when_zero',
    245             $_POST
    246         ) && true === (bool) $_POST['xpv_hide_price_when_zero'] ) {
    247             update_post_meta( $product_id, 'xpv_camera_position_thumbnail', sanitize_text_field( $_POST['xpv_camera_position_thumbnail'] ) );
    248245        } else {
    249246            delete_post_meta( $product_id, 'xpv_camera_position_thumbnail' );
  • expivi/trunk/classes/woocommerce/class-expivi-configurator.php

    r2825298 r2900195  
    246246                array(
    247247                    'theme'                  => $theme,
    248                     'btnOnForm'              => $this->get_setting( 'smd_button_on_form', '', 'expivi-smd-settings' ),
     248                    'btnOnForm'              => $this->get_setting( 'smd_button_on_form', 'Save my design', 'expivi-smd-settings' ),
    249249                    'state_selection'        => $state_selection,
    250250                    'states_html_options'    => empty( $states_html_options ) ? '' : $states_html_options,
  • expivi/trunk/expivi.php

    r2897250 r2900195  
    44 * Description: Complex visualisation and configuration made simple
    55 * Plugin URI: https://wordpress.org/plugins/expivi/
    6  * Version: 2.7.5
     6 * Version: 2.7.6
    77 * Author: Expivi
    88 * Author URI: https://www.expivi.com/
  • expivi/trunk/languages/expivi-nl_NL.po

    r2897250 r2900195  
    55"Project-Id-Version: Expivi 1.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/expivi\n"
    7 "POT-Creation-Date: 2023-04-11 11:25+0200\n"
    8 "PO-Revision-Date: 2023-04-11 11:25+0200\n"
     7"POT-Creation-Date: 2023-04-17 10:33+0200\n"
     8"PO-Revision-Date: 2023-04-17 10:33+0200\n"
    99"Last-Translator: \n"
    1010"Language-Team: \n"
  • expivi/trunk/languages/expivi.pot

    r2897250 r2900195  
    66"Project-Id-Version: Expivi 1.0\n"
    77"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/expivi\n"
    8 "POT-Creation-Date: 2023-04-11 11:25+0200\n"
     8"POT-Creation-Date: 2023-04-17 10:33+0200\n"
    99"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
    1010"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  • expivi/trunk/readme.txt

    r2897250 r2900195  
    55Tested up to: 6.1.1
    66Requires PHP: 7.1
    7 Stable tag: 2.7.5
     7Stable tag: 2.7.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    3636
    3737== Changelog ==
     38= 2.7.6 2023/04/17 =
     39* Fixed: Fixed 'Camera position' and 'Show progress' setting in product settings.
     40* New: Configured product details are now shown in Save My Design mails.
     41
    3842= 2.7.5 2023/04/11 =
    3943* Fixed: Update viewer to 1.25.2.
    40 * Fixed: Fixed 'Camera position' and 'Show progress' setting in product settings.
    4144
    4245= 2.7.4 2023/04/03 =
  • expivi/trunk/templates/emails/connect-rep/email_connect_rep_content.phtml

    r2714461 r2900195  
    11<?php
    22/**
    3  * Email View - Connect Rep Content
     3 * Email View - Connect Representative Content
    44 *
    5  * @version 1.0
     5 * @version 1.0.1
    66 */
    77
    88if ( ! defined( 'ABSPATH' ) ) {
    9     exit;
     9    exit;
    1010}
     11
     12/** @var mixed  $user_data Data filled by user in Save My Design form. */
     13/** @var string $share_link Link pointing to product page including id of the configuration so the configuration will be loaded. */
     14/** @var string $shop_name Name of the shop. */
     15/** @var array  $configuration Array of configured products. */
    1116?>
    1217<div>
    13     <h1 style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#2f3133;font-size:19px;font-weight:bold;margin-top:0;text-align:left">Hi</h1>
    14     <br>
    15     <p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">
    16         <?php echo $user_data['name'] ?? 'A customer'?> has requested contact with a sale representative.
    17     </p>
    18     <br>
    19     <table style="border-collapse:collapse;border-spacing:0;text-align: center; width:100%;" class="tg">
    20         <tbody>
    21         <?php foreach($user_data as $key => $data): ?>
    22         <tr>
    23             <td style="border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;overflow:hidden;padding:10px 5px;vertical-align:top;word-break:normal">
    24                 <p style="text-transform:capitalize;font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;font-size:16px;line-height:1.5em;margin-top:0;text-align:center">
    25                     <strong><?php echo $key ?></strong>
    26                 </p>
    27             </td>
    28             <td style="border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;overflow:hidden;padding:10px 5px;vertical-align:top;word-break:normal">
    29                 <p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:center">
    30                     <?php echo $data ?>
    31                 </p>
    32             </td>
    33         </tr>
    34         <?php endforeach; ?>
    35         </tbody>
    36     </table>
    37     <br>
    38     <a href="<?php echo esc_attr($share_link); ?>" style="margin-right:auto;margin-left:auto;font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;border-radius:3px;color:#fff;display:inline-block;text-decoration:none;background-color:#3f3f3f;border-top:10px solid #3f3f3f;border-right:18px solid #3f3f3f;border-bottom:10px solid #3f3f3f;border-left:18px solid #3f3f3f">
    39         Go to the saved design
    40     </a>
    41     <br>
    42     <p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">Regards,</p>
    43     <strong style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">Expivi</strong>
     18    <h1 style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#2f3133;font-size:19px;font-weight:bold;margin-top:0;text-align:left">Hi</h1>
     19    <br>
     20    <p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">
     21        <?php echo $user_data['name'] ?? 'A customer'?> has requested contact with a sale representative.
     22    </p>
     23    <br>
     24    <table style="border-collapse:collapse;border-spacing:0;text-align: center; width:100%;" class="tg">
     25        <tbody>
     26        <?php foreach($user_data as $key => $data): ?>
     27        <tr>
     28            <td style="border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;overflow:hidden;padding:10px 5px;vertical-align:top;word-break:normal">
     29                <p style="text-transform:capitalize;font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;font-size:16px;line-height:1.5em;margin-top:0;text-align:center">
     30                    <strong><?php echo $key ?></strong>
     31                </p>
     32            </td>
     33            <td style="border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;overflow:hidden;padding:10px 5px;vertical-align:top;word-break:normal">
     34                <p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:center">
     35                    <?php echo $data ?>
     36                </p>
     37            </td>
     38        </tr>
     39        <?php endforeach; ?>
     40        </tbody>
     41    </table>
     42    <br>
     43    <a href="<?php echo esc_attr($share_link); ?>" style="margin-right:auto;margin-left:auto;font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;border-radius:3px;color:#fff;display:inline-block;text-decoration:none;background-color:#3f3f3f;border-top:10px solid #3f3f3f;border-right:18px solid #3f3f3f;border-bottom:10px solid #3f3f3f;border-left:18px solid #3f3f3f">
     44        Go to the saved design
     45    </a>
     46    <br>
     47    <br>
     48
     49    <p>Configuration details:</p>
     50    <?php
     51    // Display attributes of configured products.
     52    if ( ! empty( $configuration ) ) {
     53        foreach ( $configuration as $configured_product ) {
     54            $attributes = $configured_product['attributes'];
     55            foreach ( $attributes as $attribute ) {
     56                if ( ! empty( $attribute['attribute_name'] ) && ! empty( $attribute['attribute_value_name'] ) ) {
     57                    echo '<b>' . esc_html( $attribute['attribute_name'] ) . '</b> ' . esc_html( $attribute['attribute_value_name'] ) . '<br />';
     58                }
     59            }
     60        }
     61    }
     62    ?>
     63
     64    <br>
     65    <p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">Regards,</p>
     66    <strong style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left"><?php echo $shop_name; ?></strong>
    4467</div>
  • expivi/trunk/templates/emails/save-design/email_save_design_content.phtml

    r2714461 r2900195  
    33 * Email View - Save Design Content
    44 *
    5  * @version 1.0
     5 * @version 1.0.1
    66 */
    77
    88if ( ! defined( 'ABSPATH' ) ) {
    9     exit;
     9    exit;
    1010}
     11
     12/** @var mixed  $user_data Data filled by user in Save My Design form. */
     13/** @var string $share_link Link pointing to product page including id of the configuration so the configuration will be loaded. */
     14/** @var string $shop_name Name of the shop. */
     15/** @var array  $configuration Array of configured products. */
    1116?>
     17
     18
    1219<h1 style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#2f3133;font-size:19px;font-weight:bold;margin-top:0;text-align:left">Hi <?php echo $user_data['name']?></h1>
    1320<p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">Here is your saved design!</p>
    1421<a href="<?php echo esc_attr($share_link); ?>" style="margin-right:auto;margin-left:auto;font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;border-radius:3px;color:#fff;display:inline-block;text-decoration:none;background-color:#3f3f3f;border-top:10px solid #3f3f3f;border-right:18px solid #3f3f3f;border-bottom:10px solid #3f3f3f;border-left:18px solid #3f3f3f">
    15     See my saved design
     22    See my saved design
    1623</a>
     24<br>
     25<br>
     26
     27<p>Configuration details:</p>
     28<?php
     29// Display attributes of configured products.
     30if ( ! empty( $configuration ) ) {
     31    foreach ( $configuration as $configured_product ) {
     32        $attributes = $configured_product['attributes'];
     33        foreach ( $attributes as $attribute ) {
     34            if ( ! empty( $attribute['attribute_name'] ) && ! empty( $attribute['attribute_value_name'] ) ) {
     35                echo '<b>' . esc_html( $attribute['attribute_name'] ) . '</b> ' . esc_html( $attribute['attribute_value_name'] ) . '<br />';
     36            }
     37        }
     38    }
     39}
     40?>
     41
    1742<br>
    1843<p style="font-family:'Work Sans',Avenir,Helvetica,sans-serif;box-sizing:border-box;color:#74787e;font-size:16px;line-height:1.5em;margin-top:0;text-align:left">Regards,</p>
  • expivi/trunk/vendor/composer/installed.php

    r2897250 r2900195  
    11<?php return array(
    22    'root' => array(
    3         'pretty_version' => '2.7.5',
    4         'version' => '2.7.5.0',
     3        'pretty_version' => '2.7.6',
     4        'version' => '2.7.6.0',
    55        'type' => 'library',
    66        'install_path' => __DIR__ . '/../../',
     
    3939        ),
    4040        'expivi/expivi-woocommerce' => array(
    41             'pretty_version' => '2.7.5',
    42             'version' => '2.7.5.0',
     41            'pretty_version' => '2.7.6',
     42            'version' => '2.7.6.0',
    4343            'type' => 'library',
    4444            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.