Plugin Directory

Changeset 1551250


Ignore:
Timestamp:
12/10/2016 07:47:27 AM (9 years ago)
Author:
sparkweb
Message:

version 4.7.2

Location:
foxyshop
Files:
145 added
7 edited

Legend:

Unmodified
Added
Removed
  • foxyshop/trunk/customposttype.php

    r1266209 r1551250  
    138138            $out = array();
    139139            foreach ( $terms as $c )
    140                 $out[] = "<a href='edit-tags.php?action=edit&taxonomy=$_taxonomy&post_type=book&tag_ID={$c->term_id}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
     140                $out[] = "<a href='edit-tags.php?action=edit&taxonomy=$_taxonomy&post_type=foxyshop_product&tag_ID={$c->term_id}'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'category', 'display')) . "</a>";
    141141            echo join( ', ', $out );
    142142        }
  • foxyshop/trunk/foxyshop.php

    r1293858 r1551250  
    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.7.1
     8Version: 4.7.2
    99Author URI: http://www.foxy-shop.com/
    1010
     
    3939
    4040//Setup Plugin Variables
    41 define('FOXYSHOP_VERSION', "4.7.1");
     41define('FOXYSHOP_VERSION', "4.7.2");
    4242define('FOXYSHOP_DIR', (is_ssl() ? str_replace("http://", "https://", WP_PLUGIN_URL) : WP_PLUGIN_URL) . "/foxyshop");
    4343define('FOXYSHOP_PATH', dirname(__FILE__));
     
    5656load_plugin_textdomain('foxyshop', 0, dirname(plugin_basename(__FILE__)).'/languages/');
    5757$foxycart_version_array = array('2.0' => '2.0', '1.1' => '1.1', '1.0' => '1.0', '0.7.2' => '0.7.2', '0.7.1' => '0.7.1', '0.7.0' => '0.7.0');
    58 $google_product_field_names = array('google_product_category', 'mpn', 'gtin', 'brand', 'condition', 'age_group', 'gender', 'color', 'size', 'material', 'pattern');
     58$google_product_field_names = array('google_product_category', 'mpn', 'gtin', 'identifier_exists', 'brand', 'condition', 'age_group', 'gender', 'color', 'size', 'material', 'pattern');
    5959
    6060//Setup Admin Functions
  • foxyshop/trunk/googleproductfeed.php

    r965423 r1551250  
    4848
    4949    $write = "";
    50     foreach($fieldnames as $field) {
     50    foreach($fieldnames as  $key => $field) {
    5151        if ($field != $fieldnames[0]) $write .= "\t";
    5252        if ($amazon_version) {
     53            if ($field == "identifier_exists") {
     54                unset($fieldnames[$key]);
     55                continue;
     56            }
    5357            if ($field == "product_type") $field = "category";
    5458            if ($field == "id") $field = "sku";
     
    6973        $product = foxyshop_setup_product($singleproduct);
    7074        $product = apply_filters('foxyshop_setup_product_info_google', $product);
     75        $identifier_exists = "";
    7176
    7277        foreach($fieldnames as $fieldname) {
     
    127132                case 'gtin':
    128133                    $gtin = get_post_meta($product['id'],'_gtin',1);
    129                     if (!$gtin) $gtin = $product['code'];
     134                    if ($gtin === "FALSE") {
     135                        $identifier_exists = "FALSE";
     136                        $gtin = "";
     137                    } else {
     138                        if (!$gtin) $gtin = $product['code'];
     139                    }
     140
    130141                    $write .= foxyshop_dblquotes($gtin); break;
    131 
    132142                case 'mpn':
    133143                    $mpn = get_post_meta($product['id'],'_mpn',1);
    134                     if (!$mpn) $mpn = $product['code'];
     144                    if ($mpn === "FALSE") {
     145                        $identifier_exists = "FALSE";
     146                        $mpn = "";
     147                    } else {
     148                        if (!$mpn) $mpn = $product['code'];
     149                    }
    135150                    $write .= foxyshop_dblquotes($mpn); break;
     151
     152                case 'identifier_exists':
     153                    $write .= foxyshop_dblquotes($identifier_exists); break;
    136154
    137155                case "image_link":
     
    156174        }
    157175        $write .= "\n";
    158 
    159 
    160176    }
    161177    echo $write;
     
    243259        $xml .= '<sc:target_country>' . apply_filters("foxyshop_google_product_target_country", "US") . '</sc:target_country>'."\n";
    244260        $xml .= '<sc:content_language>en</sc:content_language>'."\n";
     261        $identifier_exists = true;
    245262        foreach($google_product_field_names as $field) {
    246263            $val = get_post_meta($product['id'],'_'.$field,1);
     264            if ($field == 'gtin' && $val == "FALSE") {
     265                $identifier_exists = false;
     266                $val = "";
     267            }
     268            if ($field == 'mpn' && $val == "FALSE") {
     269                $identifier_exists = false;
     270                $val = "";
     271            }
    247272            if ($field == 'condition') $val = $condition;
    248             if ($field == 'gtin' && !$val) $val = $product['code'];
     273            if ($field == 'gtin' && !$val && $identifier_exists) $val = $product['code'];
     274            if ($field == 'mpn' && !$val && $identifier_exists) $val = $product['code'];
    249275            if ($val) $xml .= '<scp:'.$field.'>' . esc_attr($val) . '</scp:'.$field.'>'."\n";
    250276        }
     277
     278        //No GTIN or MPN
     279        if (!$identifier_exists) {
     280            $xml .= '<scp:identifier_exists>FALSE</scp:identifier_exists>'."\n";
     281        }
     282
    251283        $xml .= '<scp:availability>in stock</scp:availability>'."\n";
    252284        $xml .= '<scp:price unit="' . apply_filters("foxyshop_google_product_currency", "usd") . '">' . $product['originalprice'] . '</scp:price>'."\n";
  • foxyshop/trunk/helperfunctions.php

    r1266209 r1551250  
    149149    $new_product['images'] = array();
    150150    if (!$shortcut) {
     151
     152        //Get Featured Image
    151153        $imageNumber = 0;
    152154        $featuredImageID = (has_post_thumbnail($thepost->ID) ? get_post_thumbnail_id($thepost->ID) : 0);
     155
     156        //Get Attachments
    153157        $attachments = get_posts(array('numberposts' => -1, 'post_type' => 'attachment','post_status' => null,'post_parent' => $thepost->ID, "post_mime_type" => "image", 'order' => 'ASC','orderby' => 'menu_order'));
    154         if (!$attachments && $featuredImageID) {
    155             $attachments = get_posts(array("p" => $featuredImageID, 'post_type' => 'attachment', "post_mime_type" => "image"));
     158
     159        //Search For Featured Image in Attachments
     160        $featured_image_in_attachments = false;
     161        foreach ($attachments as $cur_value) {
     162            if ($cur_value->ID == $featuredImageID) {
     163                $featured_image_in_attachments = true;
     164            }
     165        }
     166        if ((!$attachments && $featuredImageID) || !$featured_image_in_attachments) {
     167            $attachments = array_merge($attachments, get_posts(array("p" => $featuredImageID, 'post_type' => 'attachment', "post_mime_type" => "image")));
    156168        }
    157169        $sizes = get_intermediate_image_sizes();
  • foxyshop/trunk/readme.txt

    r1293858 r1551250  
    44Tags: foxycart, shopping, cart, inventory, management, ecommerce, selling, subscription, foxy
    55Requires at least: 3.1
    6 Tested up to: 4.4
    7 Stable tag: 4.7.1
     6Tested up to: 4.7
     7Stable tag: 4.7.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6868
    6969== Changelog ==
     70
     71= 4.7.2 =
     72* Show featured image in a group even if it wasn't uploaded to product
     73* Updating Google Product Feed to allow identifier_exists=false value
     74* Widget class name updates to support PHP 7
    7075
    7176= 4.7.1 =
  • foxyshop/trunk/settings-page.php

    r1010947 r1551250  
    435435                    <input type="checkbox" id="foxyshop_ship_to" name="foxyshop_enable_ship_to"<?php checked($foxyshop_settings['enable_ship_to'], "on"); ?> />
    436436                    <label for="foxyshop_ship_to"><?php _e('Enable Multi-Ship', 'foxyshop'); ?></label>
    437                     <a href="#" class="foxyshophelp">Remember that FoxyCart charges an extra fee for this service. You must enable it on your FoxyCart account or it will not work. NOTE: At this time, this feature is not available for multi-ship stores.</a>
     437                    <a href="#" class="foxyshophelp">You must enable this feature on your FoxyCart account or it will not work.</a>
    438438                </td>
    439439            </tr>
  • foxyshop/trunk/widgetcode.php

    r1219461 r1551250  
    1515
    1616    //Widget Setup
    17     function FoxyShop_Category() {
     17    function __construct() {
    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');
     
    135135
    136136    //Widget Setup
    137     function FoxyShop_Cart_Link() {
     137    function __construct() {
    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');
     
    209209
    210210    //Widget setup.
    211     function FoxyShop_Category_List() {
     211    function __construct() {
    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');
Note: See TracChangeset for help on using the changeset viewer.