Plugin Directory

Changeset 2483148


Ignore:
Timestamp:
02/28/2021 10:01:15 PM (5 years ago)
Author:
3dcart
Message:

Rebranding 3dcart -> shift4shop

Location:
3dcart-wp-online-store/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 3dcart-wp-online-store/trunk/3dcart.php

    r2479948 r2483148  
    44  Plugin URI: http://wordpress.org/extend/plugins/3dcart-wp-online-store/
    55  Description: This is an official plugin of Shift4Shop, to fetch products from your shop and display it in widget.
    6   Author: 3dcart
     6  Author: shift4shop
    77  Version: V.2.1
    88  Author URI: http://shift4shop.com
     
    1010$application_registered = "";
    1111
    12 class W_3dCartProduct_Widget extends WP_Widget {
     12class W_Shift4ShopProduct_Widget extends WP_Widget {
    1313
    1414      public function __construct() {
    1515        parent::__construct(
    16             '3dcart_widget', // Base ID
     16            'shift4shop_widget', // Base ID
    1717            'Shift4Shop Online Store', // Name
    1818            array('description' => __('Display list of products from your shop', 'text_domain'),) // Args
     
    3131          $cssstyle = $instance['cssstyle'];
    3232        } else {
    33           $title = __('3d Cart Products', 'text_domain');
     33          $title = __('Shift4Shop Products', 'text_domain');
    3434          $url = '';
    3535          $item_sel = 'home';
     
    182182        //$array = $arrayXML['rss']['channel']['item'];
    183183
    184         echo "<div class='w3dcart-product-" . $cssstyle . "'>";
     184        echo "<div class='wshift4shop-product-" . $cssstyle . "'>";
    185185        foreach ($arrayXML->channel->item as $key => $value) {
    186                     echo "<div class='w3dcart-products-item'>";
     186                    echo "<div class='wshift4shop-products-item'>";
    187187                    echo $value->description;//['description'];
    188188                    echo "</div>";
     
    322322}
    323323
    324 function wp_3dcart_init() {
     324function wp_shift4shop_init() {
    325325      global $application_registered;
    326       $application_registered = get_option('wp3dcart_application_registered');
     326      $application_registered = get_option('wpshift4shop_application_registered');
    327327      if ($application_registered == "")
    328         wp3dcart_admin_warnings();
    329 }
    330 
    331 //delete_option('wp3dcart_application_registered');
    332 $application_registered = get_option('wp3dcart_application_registered');
     328        wpshift4shop_admin_warnings();
     329}
     330
     331//delete_option('wpshift4shop_application_registered');
     332$application_registered = get_option('wpshift4shop_application_registered');
    333333if ($application_registered == true)
    334       add_action('widgets_init', create_function('', 'register_widget( "W_3dCartProduct_Widget" );'));
    335 
    336 function wp3dcart_admin_warnings() {
    337       //if (!get_option('wp3dcart_application_registered') && !$wpcom_api_key && !isset($_POST['submit'])) {
    338     if (!get_option('wp3dcart_application_registered') && !isset($_POST['submit'])) {
    339 
    340         function w3dcart_warning() {
    341           echo "<div id='wp3dcart-warning' class='updated fade'><p><strong>" . __('Shift4Shop plugin is almost ready.') . "</strong> " . sprintf(__('You must <a href="%1$s"> register to use it </a>.'), "?page=3dcart-wp-online-store/3dcart.php") . "</p></div>";
    342         }
    343 
    344         add_action('admin_notices', 'w3dcart_warning');
     334      add_action('widgets_init', create_function('', 'register_widget( "W_Shift4ShopProduct_Widget" );'));
     335
     336function wpshift4shop_admin_warnings() {
     337      //if (!get_option('wpshift4shop_application_registered') && !$wpcom_api_key && !isset($_POST['submit'])) {
     338    if (!get_option('wpshift4shop_application_registered') && !isset($_POST['submit'])) {
     339
     340        function wshift4shop_warning() {
     341          echo "<div id='wpshift4shop-warning' class='updated fade'><p><strong>" . __('Shift4Shop plugin is almost ready.') . "</strong> " . sprintf(__('You must <a href="%1$s"> register to use it </a>.'), "?page=3dcart-wp-online-store/3dcart.php") . "</p></div>";
     342        }
     343
     344        add_action('admin_notices', 'wshift4shop_warning');
    345345        return;
    346346      }
    347347}
    348348
    349 add_action('init', 'wp_3dcart_init');
    350 add_action('wp_enqueue_scripts', 'W_3dCartProduct_Widget_stylesheet');
    351 
    352 function W_3dCartProduct_Widget_stylesheet() {
     349add_action('init', 'wp_shift4shop_init');
     350add_action('wp_enqueue_scripts', 'W_Shift4ShopProduct_Widget_stylesheet');
     351
     352function W_Shift4ShopProduct_Widget_stylesheet() {
    353353      $myStyleUrl = plugins_url('style.css', __FILE__); // Respects SSL, Style.css is relative to the current file
    354354      $myStyleFile = WP_PLUGIN_DIR . '/3dcart/style.css';
     355      if (file_exists($myStyleFile) <> 1) {
     356          $myStyleFile = WP_PLUGIN_DIR . '/3dcart-wp-online-store/style.css';
     357      }
    355358      if (file_exists($myStyleFile)) {
    356359        wp_register_style('myStyleSheets', $myStyleUrl);
     
    360363
    361364// create custom plugin settings menu
    362 add_action('admin_menu', 'wp3dcart_create_menu');
    363 
    364 function wp3dcart_create_menu() {
     365add_action('admin_menu', 'wpshift4shop_create_menu');
     366
     367function wpshift4shop_create_menu() {
    365368      //create new top-level menu
    366       add_menu_page('Shift4Shop Plugin Settings', 'Shift4Shop Settings', 'administrator', __FILE__, 'wp3dcart_settings_page');
     369      add_menu_page('Shift4Shop Plugin Settings', 'Shift4Shop Settings', 'administrator', __FILE__, 'wpshift4shop_settings_page');
    367370      //call register settings function
    368       add_action('admin_init', 'register_wp3dcart_settings');
    369 }
    370 
    371 function register_wp3dcart_settings() {
     371      add_action('admin_init', 'register_wpshift4shop_settings');
     372}
     373
     374function register_wpshift4shop_settings() {
    372375      //register our settings
    373       register_setting('wp3dcart-settings-group', 'wp3dcart_store_url');
    374       register_setting('wp3dcart-settings-group', 'wp3dcart_user_email');
    375       register_setting('wp3dcart-settings-group', 'wp3dcart_user_phone');
    376 }
    377 
    378 function wp3dcart_settings_page() {
     376      register_setting('wpshift4shop-settings-group', 'wpshift4shop_store_url');
     377      register_setting('wpshift4shop-settings-group', 'wpshift4shop_user_email');
     378      register_setting('wpshift4shop-settings-group', 'wpshift4shop_user_phone');
     379}
     380
     381function wpshift4shop_settings_page() {
    379382
    380383      if ($_SERVER['REQUEST_METHOD'] == "POST") {
    381         update_option("wp3dcart_store_url", $_POST['wp3dcart_store_url']);
    382         update_option("wp3dcart_user_email", $_POST['wp3dcart_user_email']);
    383         update_option("wp3dcart_user_phone", $_POST['wp3dcart_user_phone']);
    384         $url = "http://www.shift4shop.com/wordpress-plugin/verify.asp?type=1";
     384        update_option("wpshift4shop_store_url", $_POST['wpshift4shop_store_url']);
     385        update_option("wpshift4shop_user_email", $_POST['wpshift4shop_user_email']);
     386        update_option("wpshift4shop_user_phone", $_POST['wpshift4shop_user_phone']);
     387        $url = "https://www.shift4shop.com/wordpress-plugin/verify.asp?type=1";
    385388        $url .= "&siteurl=" . $_POST['siteurl'];
    386         $url .= "&storeurl=" . urldecode($_POST['wp3dcart_store_url']);
    387         $url .= "&email=" . urlencode($_POST['wp3dcart_user_email']);
    388         $url .= "&phone=" . urlencode($_POST['wp3dcart_user_phone']);
     389        $url .= "&storeurl=" . urldecode($_POST['wpshift4shop_store_url']);
     390        $url .= "&email=" . urlencode($_POST['wpshift4shop_user_email']);
     391        $url .= "&phone=" . urlencode($_POST['wpshift4shop_user_phone']);
    389392        //echo $url;
    390393        $ch = curl_init($url);
     
    400403        if(file_get_contents($url)) {
    401404                  error_reporting(0);
    402           update_option("wp3dcart_application_registered", true);
     405          update_option("wpshift4shop_application_registered", true);
    403406          header("Location:/wp-admin/plugins.php?page=3dcart-wp-online-store/3dcart.php");
    404407        }
     
    411414
    412415            <form method="post" action="?page=3dcart-wp-online-store/3dcart.php">
    413           <?php settings_fields('wp3dcart-settings-group'); ?>
    414           <?php do_settings_sections('wp3dcart-settings-group'); ?>
     416          <?php settings_fields('wpshift4shop-settings-group'); ?>
     417          <?php do_settings_sections('wpshift4shop-settings-group'); ?>
    415418            <table class="form-table">
    416419              <tr valign="top">
    417420                <th scope="row">Store URL:</th>
    418                 <td><input type="text" name="wp3dcart_store_url" value="<?php echo get_option('wp3dcart_store_url'); ?>" /></td>
     421                <td><input type="text" name="wpshift4shop_store_url" value="<?php echo get_option('wpshift4shop_store_url'); ?>" /></td>
    419422              </tr>
    420423
    421424              <tr valign="top">
    422425                <th scope="row">Your E-Mail</th>
    423                 <td><input type="text" name="wp3dcart_user_email" value="<?php echo get_option('wp3dcart_user_email'); ?>" /></td>
     426                <td><input type="text" name="wpshift4shop_user_email" value="<?php echo get_option('wpshift4shop_user_email'); ?>" /></td>
    424427              </tr>
    425428
    426429              <tr valign="top">
    427430                <th scope="row">Your Phone</th>
    428                 <td><input type="text" name="wp3dcart_user_phone" value="<?php echo get_option('wp3dcart_user_phone'); ?>" /></td>
     431                <td><input type="text" name="wpshift4shop_user_phone" value="<?php echo get_option('wpshift4shop_user_phone'); ?>" /></td>
    429432              </tr>
    430433              <tr valign="top">
  • 3dcart-wp-online-store/trunk/readme.txt

    r2479938 r2483148  
    11=== Shift4Shop: WordPress Online Store ===
    2 Contributors: 3dcart
     2Contributors: shift4shop
    33Donate link: http://www.shift4shop.com/
    44Tags: e-commerce, ecommerce, online store, shopping cart, Shift4Shop, Shift4Shop wordpress, Shift4Shop for WordPress, Shift4Shop online products
    55Requires at least: 2.8
    6 Tested up to: 3.8
     6Tested up to: 5.6.2
    77Stable tag: 1
    88
     
    4545== Installation ==
    46461.     Download the plugin.
    47 1.     Upload 3dcart-wp-online-store directory to the /wp-content/plugins/ directory.
     471.     Upload shift4shop-wp-online-store directory to the /wp-content/plugins/ directory.
    48481.     Activate the plugin through the 'Plugins' menu in WordPress.
    49491.     Setup the plugin on the 'Appearance > Widgets' page.
  • 3dcart-wp-online-store/trunk/style.css

    r522590 r2483148  
    1 .w3dcart-product-simple table{
     1.wshift4shop-product-simple table{
    22      width:100%;
    33}
    4 .w3dcart-product-simple .add-to-cart, .w3dcart-product-fancy-black .add-to-cart{
     4.wshift4shop-product-simple .add-to-cart, .wshift4shop-product-fancy-black .add-to-cart{
    55      background: url("images/add_cart2.gif") no-repeat scroll 0 0 transparent;
    66      display: block;
     
    1010      width: 115px;
    1111}
    12 .w3dcart-product-simple .w3dcart-products-item {
     12.wshift4shop-product-simple .wshift4shop-products-item {
    1313      margin-bottom: 10px;
    1414}
    15 .w3dcart-product-simple .price, .w3dcart-product-fancy-black .price {
     15.wshift4shop-product-simple .price, .wshift4shop-product-fancy-black .price {
    1616      font-size : 11px;
    1717     
     
    1919
    2020
    21 .w3dcart-product-fancy-black table{
     21.wshift4shop-product-fancy-black table{
    2222      width:100%;
    2323}
    24 .w3dcart-product-fancy-black .w3dcart-products-item{
     24.wshift4shop-product-fancy-black .wshift4shop-products-item{
    2525      background-color:white;
    2626      color:white;
     
    3232      border-radius: 10px; /* CSS3 */
    3333}
    34 .w3dcart-product-fancy-black .w3dcart-products-item a{
     34.wshift4shop-product-fancy-black .wshift4shop-products-item a{
    3535      color: #333;
    3636}
    37 .w3dcart-product-fancy-black .w3dcart-products-item .price{
     37.wshift4shop-product-fancy-black .wshift4shop-products-item .price{
    3838      color: #333;
    3939}
Note: See TracChangeset for help on using the changeset viewer.