Plugin Directory

Changeset 2521141


Ignore:
Timestamp:
04/25/2021 06:23:17 PM (5 years ago)
Author:
dbcmerchi
Message:

1.3.0

Location:
merchi
Files:
76 added
6 edited

Legend:

Unmodified
Added
Removed
  • merchi/trunk/MerchiPlugin/Api/Callbacks/AdminCallbacks.php

    r2454556 r2521141  
    5555    }
    5656
     57    public function merchiRedirectURL() {
     58        $value = esc_attr( get_option( 'merchi_redirect_url' ) );
     59        echo '<input type="text" class="regular-text" name="merchi_redirect_url" value="' . $value . '" placeholder="https://example.com/success">';
     60    }
     61
     62
    5763
    5864    // phpcs:enable
  • merchi/trunk/MerchiPlugin/Pages/Admin.php

    r2454556 r2521141  
    9292                 ],
    9393             ],
     94                         [
     95                 'option_group' => 'merchi_options_group',
     96                 'option_name'  => 'merchi_redirect_url',
     97                 'callback'     => [
     98                     $this->callbacks,
     99                     'merchiOptionsGroup',
     100                 ],
     101             ],
    94102             [
    95103                 'option_group' => 'merchi_options_group',
     
    162170            ],
    163171            [
     172                'id'       => 'merchi_redirect_url',
     173                'title'    => 'Redirect After Success URL',
     174                'callback' => [
     175                    $this->callbacks,
     176                    'merchiRedirectURL'
     177                ],
     178                'page'     => 'merchi_plugin',
     179                'section'  => 'merchi_admin_index',
     180                'args'     => [
     181                    'label_for' => 'merchi_redirect_url',
     182                    'class'     => 'example-class',
     183                ],
     184            ],
     185            [
    164186                'id'       => 'woo_k_p',
    165187                'title'    => 'Woocommerce Public Key',
  • merchi/trunk/MerchiPlugin/PublicPages/ProductPage.php

    r2454556 r2521141  
    2525            $id        = $product->get_sku();
    2626            $container = 'product-' . strval( $product->get_id() );
     27                        $redirectUrl = esc_attr( get_option( 'merchi_redirect_url' ) );
    2728            wp_enqueue_script( 'show_merchi_product', $this->plugin_url . 'assets/show_product.js' );
    2829            $script_data = [
    2930                'mountPointId' => $container,
    3031                'productId'    => $id,
     32                                'redirectAfterSuccessUrl' => $redirectUrl
    3133            ];
    3234            wp_localize_script( 'show_merchi_product', 'merchiShowProductScriptOptions', $script_data );
  • merchi/trunk/assets/show_product.js

    r2454556 r2521141  
    44  const mountpoint = document.getElementById(mountPointId);
    55  const script = document.createElement('script');
    6   script.src = `https://merchi.co//static/product_embed/js/product.embed.js?product=${productId}&hidePreview=true&hideTitle=true&hideInfo=true&hidePrice=true&includeBootstrap=false&singleColumn=true&notIncludeDefaultCss=true"`;
     6  script.src = `https://merchi.co//static/product_embed/js/product.embed.js?product=${productId}&hidePreview=true&hideTitle=true&hideInfo=true&hidePrice=true&includeBootstrap=false&singleColumn=true&notIncludeDefaultCss=true&redirectAfterSuccessUrl=${redirectAfterSuccessUrl}"`;
    77  script.dataset.name = "product-embed";
    88  mountpoint.appendChild(script);
  • merchi/trunk/merchi-plugin.php

    r2454556 r2521141  
    44 * Plugin URI:        https://merchi.co
    55 * Description:       Fetch your products from Merchi. This plugin requires Woocommerce.
    6  * Version:           1.2.1
     6 * Version:           1.3.0
    77 * Author:            Charlie Campton
    88 * License:           GPL v2 or later
  • merchi/trunk/readme.txt

    r2454556 r2521141  
    33Tags: merchi, merchandise
    44Requires at least: 5.1
    5 Tested up to: 5.6
    6 Stable tag: 1.2.1
     5Tested up to: 5.7
     6Stable tag: 1.3.0
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.