Changeset 932945
- Timestamp:
- 06/16/2014 10:18:41 AM (12 years ago)
- Location:
- woocommerce-compare-list/trunk
- Files:
-
- 7 edited
-
includes/common.php (modified) (1 diff)
-
includes/compare-page.php (modified) (2 diffs)
-
includes/shortcode.php (modified) (5 diffs)
-
index.php (modified) (1 diff)
-
languages/wccm-en_US.mo (modified) (previous)
-
languages/wccm-en_US.po (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-compare-list/trunk/includes/common.php
r932824 r932945 46 46 * Registers scripts, styles and page endpoint. 47 47 * 48 * @since 1.1 48 * @since 1.1.0 49 49 * @action init 50 50 * -
woocommerce-compare-list/trunk/includes/compare-page.php
r932859 r932945 29 29 // register action hooks 30 30 add_action( 'wp_enqueue_scripts', 'wccm_enqueue_compare_scripts' ); 31 add_action( 'template_redirect', 'wccm_set_compare_page_cookie' ); 31 32 // register filter hooks 32 33 add_filter( 'the_content', 'wccm_render_compare_page' ); … … 42 43 wp_enqueue_style( 'wccm-compare' ); 43 44 wp_enqueue_script( 'wccm-compare' ); 45 } 46 } 47 48 /** 49 * Remembers compare page to show in the widget. 50 * 51 * @since 1.1.0 52 * @action template_redirect 53 */ 54 function wccm_set_compare_page_cookie() { 55 if ( is_page() && get_option( 'wccm_compare_page' ) == get_queried_object_id() ) { 56 $list = get_query_var( wccm_get_endpoint(), false ); 57 if ( $list ) { 58 $parsed_list = array_filter( array_map( 'intval', explode( '-', $list ) ) ); 59 if ( !empty( $parsed_list ) ) { 60 $cookie = isset( $_COOKIE['compare-lists'] ) ? explode( ',', $_COOKIE['compare-lists'] ) : array(); 61 if ( in_array( $list, $cookie ) ) { 62 unset( $cookie[array_search( $list, $cookie )] ); 63 } 64 65 array_unshift( $cookie, $list ); 66 $value = implode( ',', array_slice( $cookie, 0, 5 ) ); 67 $expire = current_time( 'timestamp', 1 ) + 30 * DAY_IN_SECONDS; 68 $path = parse_url( home_url(), PHP_URL_QUERY ); 69 if ( !$path ) { 70 $path = '/'; 71 } 72 73 setcookie( 'compare-lists', $value, $expire, $path ); 74 } 75 } 44 76 } 45 77 } -
woocommerce-compare-list/trunk/includes/shortcode.php
r932824 r932945 35 35 * Enqueues scripts and styles for shortcode. 36 36 * 37 * @since 1.1 37 * @since 1.1.0 38 38 * @action wp_enqueue_scripts 39 39 */ … … 51 51 * Renders compare list shortcode. 52 52 * 53 * @since 1.1 53 * @since 1.1.0 54 54 * @shortcode products-compare 55 55 * … … 72 72 * Renders compare list table. 73 73 * 74 * @since 1.1 74 * @since 1.1.0 75 75 * 76 76 * @param array $list The array of compare products. … … 104 104 * Renders compare table header. 105 105 * 106 * @since 1.1 106 * @since 1.1.0 107 107 * 108 108 * @param array $products The compare items list. … … 140 140 * Renders compare table attributes. 141 141 * 142 * @since 1.1 142 * @since 1.1.0 143 143 * 144 144 * @param array $products The compare items list. -
woocommerce-compare-list/trunk/index.php
r932824 r932945 61 61 62 62 require_once 'includes/common.php'; 63 require_once 'includes/widget.php'; 63 64 if ( is_admin() ) { 64 65 require_once 'includes/settings.php'; -
woocommerce-compare-list/trunk/languages/wccm-en_US.po
r932816 r932945 3 3 "Project-Id-Version: WooCommerce Compare List\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2014-06-16 08:47+0300\n"6 "PO-Revision-Date: 2014-06-16 08:47+0300\n"5 "POT-Creation-Date: 2014-06-16 13:15+0300\n" 6 "PO-Revision-Date: 2014-06-16 13:15+0300\n" 7 7 "Last-Translator: Eugene Manuilov <eugene@manuilov.org>\n" 8 8 "Language-Team: MadPixels <contact@madpixels.net>\n" … … 20 20 "Plural-Forms: nplurals=2; plural=n != 1;\n" 21 21 "X-Poedit-SearchPath-0: .\n" 22 23 #: includes/widget.php:57 24 msgid "WooCommerce Recent Compares" 25 msgstr "WooCommerce Recent Compares" 26 27 #: includes/widget.php:58 28 msgid "Shows a list of user most recent compares on your site." 29 msgstr "Shows a list of user most recent compares on your site." 30 31 #: includes/widget.php:75 32 msgid "Title:" 33 msgstr "Title:" 34 35 #: includes/widget.php:78 36 msgid "Thumbnails Width:" 37 msgstr "Thumbnails Width:" 38 39 #: includes/widget.php:81 40 msgid "Thumbnails Height:" 41 msgstr "Thumbnails Height:" 42 43 #: includes/widget.php:108 44 msgid "Recent Compares" 45 msgstr "Recent Compares" 22 46 23 47 #: includes/catalog.php:77 includes/buttons.php:78 includes/settings.php:90 … … 37 61 msgstr "View compare" 38 62 39 #: includes/compare-page.php: 8463 #: includes/compare-page.php:101 40 64 msgid "No products found to compare." 41 65 msgstr "No products found to compare." -
woocommerce-compare-list/trunk/readme.txt
r932824 r932945 15 15 ### WooCommerce Compare List Plugin ### 16 16 17 The plugin adds a simple and easy to use and setup products compare feature. Compared products are shown on front end as an aggregate table of all products attributes. Users will easily compare products and make their choice. 17 The plugin adds a simple and easy to use and setup products compare feature. Compared products are shown on front end as an aggregate table of all products attributes. Users will easily compare products and make their choice. You can also use **products-compare** shortcode to embed compare tables and **WooCommerce Recent Compares** widget to help your users to get back to their compares. 18 18 19 19 ### SEO friendly ### … … 65 65 66 66 * Implemented [products-compare ids="..." atts="..."] shortcode. 67 * Implemented **Recent Compares** widget. 67 68 68 69 = 1.0.0 =
Note: See TracChangeset
for help on using the changeset viewer.