Changeset 2483148
- Timestamp:
- 02/28/2021 10:01:15 PM (5 years ago)
- Location:
- 3dcart-wp-online-store/trunk
- Files:
-
- 3 edited
-
3dcart.php (modified) (8 diffs)
-
readme.txt (modified) (2 diffs)
-
style.css (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
3dcart-wp-online-store/trunk/3dcart.php
r2479948 r2483148 4 4 Plugin URI: http://wordpress.org/extend/plugins/3dcart-wp-online-store/ 5 5 Description: This is an official plugin of Shift4Shop, to fetch products from your shop and display it in widget. 6 Author: 3dcart6 Author: shift4shop 7 7 Version: V.2.1 8 8 Author URI: http://shift4shop.com … … 10 10 $application_registered = ""; 11 11 12 class W_ 3dCartProduct_Widget extends WP_Widget {12 class W_Shift4ShopProduct_Widget extends WP_Widget { 13 13 14 14 public function __construct() { 15 15 parent::__construct( 16 ' 3dcart_widget', // Base ID16 'shift4shop_widget', // Base ID 17 17 'Shift4Shop Online Store', // Name 18 18 array('description' => __('Display list of products from your shop', 'text_domain'),) // Args … … 31 31 $cssstyle = $instance['cssstyle']; 32 32 } else { 33 $title = __(' 3d CartProducts', 'text_domain');33 $title = __('Shift4Shop Products', 'text_domain'); 34 34 $url = ''; 35 35 $item_sel = 'home'; … … 182 182 //$array = $arrayXML['rss']['channel']['item']; 183 183 184 echo "<div class='w 3dcart-product-" . $cssstyle . "'>";184 echo "<div class='wshift4shop-product-" . $cssstyle . "'>"; 185 185 foreach ($arrayXML->channel->item as $key => $value) { 186 echo "<div class='w 3dcart-products-item'>";186 echo "<div class='wshift4shop-products-item'>"; 187 187 echo $value->description;//['description']; 188 188 echo "</div>"; … … 322 322 } 323 323 324 function wp_ 3dcart_init() {324 function wp_shift4shop_init() { 325 325 global $application_registered; 326 $application_registered = get_option('wp 3dcart_application_registered');326 $application_registered = get_option('wpshift4shop_application_registered'); 327 327 if ($application_registered == "") 328 wp 3dcart_admin_warnings();329 } 330 331 //delete_option('wp 3dcart_application_registered');332 $application_registered = get_option('wp 3dcart_application_registered');328 wpshift4shop_admin_warnings(); 329 } 330 331 //delete_option('wpshift4shop_application_registered'); 332 $application_registered = get_option('wpshift4shop_application_registered'); 333 333 if ($application_registered == true) 334 add_action('widgets_init', create_function('', 'register_widget( "W_ 3dCartProduct_Widget" );'));335 336 function wp 3dcart_admin_warnings() {337 //if (!get_option('wp 3dcart_application_registered') && !$wpcom_api_key && !isset($_POST['submit'])) {338 if (!get_option('wp 3dcart_application_registered') && !isset($_POST['submit'])) {339 340 function w 3dcart_warning() {341 echo "<div id='wp 3dcart-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', 'w 3dcart_warning');334 add_action('widgets_init', create_function('', 'register_widget( "W_Shift4ShopProduct_Widget" );')); 335 336 function 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'); 345 345 return; 346 346 } 347 347 } 348 348 349 add_action('init', 'wp_ 3dcart_init');350 add_action('wp_enqueue_scripts', 'W_ 3dCartProduct_Widget_stylesheet');351 352 function W_ 3dCartProduct_Widget_stylesheet() {349 add_action('init', 'wp_shift4shop_init'); 350 add_action('wp_enqueue_scripts', 'W_Shift4ShopProduct_Widget_stylesheet'); 351 352 function W_Shift4ShopProduct_Widget_stylesheet() { 353 353 $myStyleUrl = plugins_url('style.css', __FILE__); // Respects SSL, Style.css is relative to the current file 354 354 $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 } 355 358 if (file_exists($myStyleFile)) { 356 359 wp_register_style('myStyleSheets', $myStyleUrl); … … 360 363 361 364 // create custom plugin settings menu 362 add_action('admin_menu', 'wp 3dcart_create_menu');363 364 function wp 3dcart_create_menu() {365 add_action('admin_menu', 'wpshift4shop_create_menu'); 366 367 function wpshift4shop_create_menu() { 365 368 //create new top-level menu 366 add_menu_page('Shift4Shop Plugin Settings', 'Shift4Shop Settings', 'administrator', __FILE__, 'wp 3dcart_settings_page');369 add_menu_page('Shift4Shop Plugin Settings', 'Shift4Shop Settings', 'administrator', __FILE__, 'wpshift4shop_settings_page'); 367 370 //call register settings function 368 add_action('admin_init', 'register_wp 3dcart_settings');369 } 370 371 function register_wp 3dcart_settings() {371 add_action('admin_init', 'register_wpshift4shop_settings'); 372 } 373 374 function register_wpshift4shop_settings() { 372 375 //register our settings 373 register_setting('wp 3dcart-settings-group', 'wp3dcart_store_url');374 register_setting('wp 3dcart-settings-group', 'wp3dcart_user_email');375 register_setting('wp 3dcart-settings-group', 'wp3dcart_user_phone');376 } 377 378 function wp 3dcart_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 381 function wpshift4shop_settings_page() { 379 382 380 383 if ($_SERVER['REQUEST_METHOD'] == "POST") { 381 update_option("wp 3dcart_store_url", $_POST['wp3dcart_store_url']);382 update_option("wp 3dcart_user_email", $_POST['wp3dcart_user_email']);383 update_option("wp 3dcart_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"; 385 388 $url .= "&siteurl=" . $_POST['siteurl']; 386 $url .= "&storeurl=" . urldecode($_POST['wp 3dcart_store_url']);387 $url .= "&email=" . urlencode($_POST['wp 3dcart_user_email']);388 $url .= "&phone=" . urlencode($_POST['wp 3dcart_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']); 389 392 //echo $url; 390 393 $ch = curl_init($url); … … 400 403 if(file_get_contents($url)) { 401 404 error_reporting(0); 402 update_option("wp 3dcart_application_registered", true);405 update_option("wpshift4shop_application_registered", true); 403 406 header("Location:/wp-admin/plugins.php?page=3dcart-wp-online-store/3dcart.php"); 404 407 } … … 411 414 412 415 <form method="post" action="?page=3dcart-wp-online-store/3dcart.php"> 413 <?php settings_fields('wp 3dcart-settings-group'); ?>414 <?php do_settings_sections('wp 3dcart-settings-group'); ?>416 <?php settings_fields('wpshift4shop-settings-group'); ?> 417 <?php do_settings_sections('wpshift4shop-settings-group'); ?> 415 418 <table class="form-table"> 416 419 <tr valign="top"> 417 420 <th scope="row">Store URL:</th> 418 <td><input type="text" name="wp 3dcart_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> 419 422 </tr> 420 423 421 424 <tr valign="top"> 422 425 <th scope="row">Your E-Mail</th> 423 <td><input type="text" name="wp 3dcart_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> 424 427 </tr> 425 428 426 429 <tr valign="top"> 427 430 <th scope="row">Your Phone</th> 428 <td><input type="text" name="wp 3dcart_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> 429 432 </tr> 430 433 <tr valign="top"> -
3dcart-wp-online-store/trunk/readme.txt
r2479938 r2483148 1 1 === Shift4Shop: WordPress Online Store === 2 Contributors: 3dcart2 Contributors: shift4shop 3 3 Donate link: http://www.shift4shop.com/ 4 4 Tags: e-commerce, ecommerce, online store, shopping cart, Shift4Shop, Shift4Shop wordpress, Shift4Shop for WordPress, Shift4Shop online products 5 5 Requires at least: 2.8 6 Tested up to: 3.86 Tested up to: 5.6.2 7 7 Stable tag: 1 8 8 … … 45 45 == Installation == 46 46 1. Download the plugin. 47 1. Upload 3dcart-wp-online-store directory to the /wp-content/plugins/ directory.47 1. Upload shift4shop-wp-online-store directory to the /wp-content/plugins/ directory. 48 48 1. Activate the plugin through the 'Plugins' menu in WordPress. 49 49 1. Setup the plugin on the 'Appearance > Widgets' page. -
3dcart-wp-online-store/trunk/style.css
r522590 r2483148 1 .w 3dcart-product-simple table{1 .wshift4shop-product-simple table{ 2 2 width:100%; 3 3 } 4 .w 3dcart-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{ 5 5 background: url("images/add_cart2.gif") no-repeat scroll 0 0 transparent; 6 6 display: block; … … 10 10 width: 115px; 11 11 } 12 .w 3dcart-product-simple .w3dcart-products-item {12 .wshift4shop-product-simple .wshift4shop-products-item { 13 13 margin-bottom: 10px; 14 14 } 15 .w 3dcart-product-simple .price, .w3dcart-product-fancy-black .price {15 .wshift4shop-product-simple .price, .wshift4shop-product-fancy-black .price { 16 16 font-size : 11px; 17 17 … … 19 19 20 20 21 .w 3dcart-product-fancy-black table{21 .wshift4shop-product-fancy-black table{ 22 22 width:100%; 23 23 } 24 .w 3dcart-product-fancy-black .w3dcart-products-item{24 .wshift4shop-product-fancy-black .wshift4shop-products-item{ 25 25 background-color:white; 26 26 color:white; … … 32 32 border-radius: 10px; /* CSS3 */ 33 33 } 34 .w 3dcart-product-fancy-black .w3dcart-products-item a{34 .wshift4shop-product-fancy-black .wshift4shop-products-item a{ 35 35 color: #333; 36 36 } 37 .w 3dcart-product-fancy-black .w3dcart-products-item .price{37 .wshift4shop-product-fancy-black .wshift4shop-products-item .price{ 38 38 color: #333; 39 39 }
Note: See TracChangeset
for help on using the changeset viewer.