Plugin Directory

Changeset 3459455


Ignore:
Timestamp:
02/12/2026 01:23:50 AM (4 weeks ago)
Author:
codepeople2
Message:

New version 1.3.1
Modifications in the changelogs.

Location:
music-store/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • music-store/trunk/changelog.txt

    r3458583 r3459455  
    11== Changelog ==
     2
     3= 1.3.1 =
     4
     5* Modifies the WooCommerce integration module to ensure the compatibility with latest WooCommerce updates.
    26
    37= 1.3.0 =
  • music-store/trunk/ms-core/ms-woocommerce/ms-woocommerce.php

    r2806821 r3459455  
    7070        $values['data'] instanceof MSSong_WC
    7171    ) {
    72         $item = new WC_Order_Item_Product_MS();
    73     }
     72
     73        $new_item = new WC_Order_Item_Product_MS();
     74
     75        // Copy standard props
     76        $new_item->set_props( $item->get_data() );
     77
     78        // Proper WooCommerce way to assign product
     79        $product = $values['data'];
     80
     81        $new_item->set_product( $product );
     82        $new_item->set_product_id( $product->get_id() );
     83        $new_item->set_variation_id( ! empty( $values['variation_id'] ) ? $values['variation_id'] : 0 );
     84
     85        return $new_item;
     86    }
     87
    7488    return $item;
    7589} // End ms_woocommerce_checkout_create_order_line_item_object
    7690
    7791function ms_woocommerce_get_order_item_classname( $classname, $item_type, $id ) {
    78     global $wpdb;
    79 
    80     if ( 'WC_Order_Item_Product' == $classname ) {
    81         $post_type = $wpdb->get_var( $wpdb->prepare( 'SELECT posts.post_type FROM ' . $wpdb->prefix . 'wc_order_product_lookup product_loockup INNER JOIN ' . $wpdb->posts . ' posts ON (product_loockup.product_id=posts.ID) WHERE order_item_id=%d', $id ) );
    82 
    83         if ( ! empty( $post_type ) && 'ms_song' == $post_type ) {
    84             return 'WC_Order_Item_Product_MS';
    85         }
    86     }
     92    if ( 'WC_Order_Item_Product' !== $classname ) {
     93        return $classname;
     94    }
     95
     96    $product_id = wc_get_order_item_meta( $id, '_product_id', true );
     97
     98    if ( ! $product_id ) {
     99        return $classname;
     100    }
     101
     102    $post = get_post( $product_id );
     103
     104    if ( $post && $post->post_type === 'ms_song' ) {
     105        return 'WC_Order_Item_Product_MS';
     106    }
     107
    87108    return $classname;
    88109
     
    217238);
    218239
     240add_action(
     241    'woocommerce_checkout_create_order_line_item',
     242    function( $item, $cart_item_key, $values ) {
     243        if ( isset( $values['data'] ) && $values['data'] instanceof MSSong_WC ) {
     244            $item->set_product_id( $values['data']->get_id() );
     245        }
     246    },
     247    20,
     248    3
     249);
     250
    219251// EDIT GLOBAL SETTINGS
    220252
  • music-store/trunk/ms-layouts/03/style.css

    r2334552 r3459455  
    1919.music-store-header
    2020{
    21     z-index: 99999;
     21    z-index: 9999;
    2222    min-height:48px;
    2323}
  • music-store/trunk/music-store.php

    r3458583 r3459455  
    33Plugin Name: Music Store - WordPress eCommerce
    44Plugin URI: http://musicstore.dwbooster.com
    5 Version: 1.3.0
     5Version: 1.3.1
    66Author: CodePeople
    77Author URI: http://musicstore.dwbooster.com
     
    121121    class MusicStore {
    122122
    123         public static $version = '1.3.0';
     123        public static $version = '1.3.1';
    124124
    125125        private $music_store_slug = 'music-store-menu';
  • music-store/trunk/readme.txt

    r3458583 r3459455  
    55Requires at least: 3.5.0
    66Tested up to: 6.9
    7 Stable tag: 1.3.0
     7Stable tag: 1.3.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    577577== Changelog ==
    578578
     579= 1.3.1 =
     580
     581* Modifies the WooCommerce integration module to ensure the compatibility with latest WooCommerce updates.
     582
    579583= 1.3.0 =
    580584
Note: See TracChangeset for help on using the changeset viewer.