Plugin Directory

Changeset 1219461


Ignore:
Timestamp:
08/12/2015 06:51:10 PM (11 years ago)
Author:
sparkweb
Message:

Version 4.6.2

Location:
foxyshop
Files:
167 added
5 edited

Legend:

Unmodified
Added
Removed
  • foxyshop/trunk/bulkeditor.php

    r829231 r1219461  
    113113                    <label for="_weight_status1"><?php echo $change_to_text; ?>:</label>
    114114                    <input type="text" name="_weight" id="_weight" value="" class="cfbe_field_name" onfocus="jQuery('#_weight_status1').prop('checked', true);" />
    115                     <small>enter 5 lbs, 2 oz as "5 2"</small>
     115                    <small>enter 5 lbs, 2 oz as "5 2" or +5% or -5.00</small>
    116116                    <div style="clear: both;"></div>
    117117                </td>
     
    356356
    357357    //Generic Fields Needing No Special Treatment
    358     $fields = array("category", "weight", "discount_quantity_amount", "discount_quantity_percentage", "discount_price_amount", "discount_price_percentage", "sub_frequency", "sub_startdate", "sub_enddate");
     358    $fields = array("category", "discount_quantity_amount", "discount_quantity_percentage", "discount_price_amount", "discount_price_percentage", "sub_frequency", "sub_startdate", "sub_enddate");
    359359    foreach ($fields as $field) {
    360360        if ($_POST['_' . $field . '_status'] == 1) cfbe_save_meta_data('_'.$field, $_POST['_'.$field]);
     
    363363
    364364    //Generic Price Fields Needing Special Treatment
    365     $fields = array("price", "saleprice");
     365    $fields = array("price", "saleprice", "weight");
    366366    foreach ($fields as $field) {
    367367        if ($_POST['_' . $field . '_status'] == 1 && $_POST['_' . $field] != "") {
     
    373373            if ($modifier == "+" || $modifier == "-") {
    374374
     375
     376                //Is This Weight?
     377                if ($field === "weight") {
     378                    $original_price = get_post_meta($post_id,'_weight', true);
     379                    $weight = explode(" ", $original_price);
     380                    if (count($weight) == 1) $weight = explode(" ", $foxyshop_settings['default_weight']);
     381                    $weight1 = (int)$weight[0];
     382                    $weight2 = (double)$weight[1];
     383                    if ($weight1 == 0 && $weight2 == 0) {
     384                        $defaultweight = explode(" ",$foxyshop_settings['default_weight']);
     385                        $weight1 = (int)$defaultweight[0];
     386                        $weight2 = (count($defaultweight) > 1 ? (double)$defaultweight[1] : 0);
     387                    }
     388                    if ($weight2 > 0) $weight2 = number_format($weight2 / ($foxyshop_settings['weight_type'] == 'metric' ? 1000 : 16), 3);
     389                    $arr_weight2 = explode('.', $weight2);
     390                    $weight2 = ((strpos($weight2, '.') !== false) ? end($arr_weight2) : $weight2);
     391                    $original_price = (double)($weight1 . "." . $weight2);
     392
    375393                //Get original price
    376                 $original_price = (double)get_post_meta($post_id,'_' . $field, true);
     394                } else {
     395                    $original_price = (double)get_post_meta($post_id,'_' . $field, true);
     396                }
    377397
    378398                //Percentage
     
    400420            }
    401421
    402             if ($new_price < 0) $new_price = 0;
    403             $new_price = number_format($new_price, 2);
     422            //Is This Weight?
     423            if ($field === "weight") {
     424                $new_price = (string)number_format($new_price, 2);
     425                $to_split = explode(".", $new_price);
     426                $new_price = $to_split[0] . " " . $to_split[0];
     427
     428            //Just a Price
     429            } else {
     430                if ($new_price < 0) $new_price = 0;
     431                $new_price = number_format($new_price, 2);
     432            }
    404433
    405434            //Do the save
  • foxyshop/trunk/foxyshop.php

    r1164204 r1219461  
    66Description: FoxyShop is a full integration for FoxyCart and WordPress, providing a robust shopping cart and inventory management tool.
    77Author: SparkWeb Interactive, Inc.
    8 Version: 4.6.1
     8Version: 4.6.2
    99Author URI: http://www.foxy-shop.com/
    1010
    1111**************************************************************************
    1212
    13 Copyright (C) 2014 SparkWeb Interactive, Inc.
     13Copyright (C) 2015 SparkWeb Interactive, Inc.
    1414
    1515This program is free software; you can redistribute it and/or
     
    3939
    4040//Setup Plugin Variables
    41 define('FOXYSHOP_VERSION', "4.6.1");
     41define('FOXYSHOP_VERSION', "4.6.2");
    4242define('FOXYSHOP_DIR', (is_ssl() ? str_replace("http://", "https://", WP_PLUGIN_URL) : WP_PLUGIN_URL) . "/foxyshop");
    4343define('FOXYSHOP_PATH', dirname(__FILE__));
  • foxyshop/trunk/readme.txt

    r1164208 r1219461  
    44Tags: foxycart, shopping, cart, inventory, management, ecommerce, selling, subscription, foxy
    55Requires at least: 3.1
    6 Tested up to: 4.2.2
    7 Stable tag: 4.6.1
     6Tested up to: 4.3
     7Stable tag: 4.6.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868
    6969== Changelog ==
     70
     71= 4.6.2 =
     72* WP 4.3 compatibility changes with widget constructor
     73* SSO endpoint now listens for update/cancellation and doesn't query cart in those cases
    7074
    7175= 4.6.1 =
     
    209213== Upgrade Notice ==
    210214
    211 = 4.6 =
    212 Expired feature, checkout reverse login feature
     215= 4.6.2 =
     216WP_Widget Fix For WordPress 4.3 Compatibility
  • foxyshop/trunk/ssoendpoint.php

    r1073057 r1219461  
    88    global $current_user;
    99
    10     //Run an action here in case you want to to intercept
    11     do_action("foxyshop_sso_endpoint");
     10    //Run an action here in case you want to to intercept (only if there's no special checkout type)
     11    if (!isset($_GET['checkout_type'])) {
     12        do_action("foxyshop_sso_endpoint");
     13    }
    1214
    1315    $login_url = get_bloginfo('wpurl') . '/wp-login.php';
     
    2527
    2628        //Check Cart Contents to Decide on Redirect
    27         } elseif ($foxyshop_settings['sso_account_required'] == 2) {
     29        } elseif ($foxyshop_settings['sso_account_required'] == 2 && !isset($_GET['checkout_type'])) {
    2830            $ch = curl_init();
    2931            if (!defined('FOXYSHOP_CURL_CONNECTTIMEOUT')) define('FOXYSHOP_CURL_CONNECTTIMEOUT', 10);
     
    106108    $redirect_complete = 'https://' . $foxyshop_settings['domain'] . '/checkout?fc_auth_token=' . $auth_token . '&fc_customer_id=' . $customer_id . '&timestamp=' . $newtimestamp . '&fcsid=' . $fcsid;
    107109
    108     header('Location: ' . $redirect_complete);
     110    wp_redirect($redirect_complete, 301);
    109111    die;
    110112}
  • foxyshop/trunk/widgetcode.php

    r1126583 r1219461  
    1818        $widget_ops = array('classname' => 'foxyshop_category', 'description' => sprintf(__('Show the contents of a FoxyShop %s category.', 'foxyshop'), strtolower(FOXYSHOP_PRODUCT_NAME_SINGULAR)));
    1919        $control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'foxyshop-category-widget');
    20         $this->WP_Widget('foxyshop-category-widget', __('FoxyShop Category', 'foxyshop'), $widget_ops, $control_ops);
     20        parent::__construct('foxyshop-category-widget', __('FoxyShop Category', 'foxyshop'), $widget_ops, $control_ops);
    2121    }
    2222
     
    138138        $widget_ops = array('classname' => 'foxyshop_cart_link', 'description' => __('Show a link to view shopping cart.', 'foxyshop'));
    139139        $control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'foxyshop-cart-link-widget');
    140         $this->WP_Widget('foxyshop-cart-link-widget', __('FoxyShop Cart Link', 'foxyshop'), $widget_ops, $control_ops);
     140        parent::__construct('foxyshop-cart-link-widget', __('FoxyShop Cart Link', 'foxyshop'), $widget_ops, $control_ops);
    141141    }
    142142
     
    212212        $widget_ops = array('classname' => 'foxyshop_category_list', 'description' => __('Show the FoxyShop category list.', 'foxyshop'));
    213213        $control_ops = array('width' => 300, 'height' => 350, 'id_base' => 'foxyshop-category-list-widget');
    214         $this->WP_Widget('foxyshop-category-list-widget', __('FoxyShop Category List', 'foxyshop'), $widget_ops, $control_ops);
     214        parent::__construct('foxyshop-category-list-widget', __('FoxyShop Category List', 'foxyshop'), $widget_ops, $control_ops);
    215215    }
    216216
Note: See TracChangeset for help on using the changeset viewer.