Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter benventer83

    (@benventer83)

    Still did not work, even alert yes does not work. Usually alert yes works, good indication that ajax is working but in this case alert yes does not work. Is there maybe a test that we can do to see if ajax is working fine and the path is correct?

    Thread Starter benventer83

    (@benventer83)

    add_action('wp_ajax_dynamic_price', 'get_update_dynamic_price_xyz');
    add_action('wp_ajax_nopriv_dynamic_price', 'get_update_dynamic_price_xyz');
    
    function get_update_dynamic_price_xyz()
    {
        global $product;
    
        /**
        * Get the discount details of given product with custom price
        * @param $price float/integer
        * @param $product object (Product object Example: wc_get_product($product_id))
        * @param $quantity int
        * @param $custom_price float/integer (0 for calculate discount from product price)
        * @param $return_details string (Default value 'discounted_price' accepted values = 'discounted_price','all')
        * @param $manual_request boolean (Default value false: pass this as true for get discount even if there is no item in cart)
        * @param $is_cart boolean (Default value true)
        * @return array|float|int - is product has no discounts, returns $price;else return array of discount details based on $return_details
        */
    	
    	if (isset($_POST['quantity'])) {
    		$qty = $_POST['quantity'];
    	} else {
    		$qty = 3;
    	}
        
        $price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $product->get_price(), $product->get_id(), $qty, 0, 'discounted_price', 'true', 'true');
    
        if ($price == '')
        {
            $price = $product->get_price();
        }
    
        //echo $price;
    	wp_send_json_success( $price );
    }
    
    function action_woocommerce_single_product_summary()
    {
        global $product;
    
        /**
        * Get the discount details of given product with custom price
        * @param $price float/integer
        * @param $product object (Product object Example: wc_get_product($product_id))
        * @param $quantity int
        * @param $custom_price float/integer (0 for calculate discount from product price)
        * @param $return_details string (Default value 'discounted_price' accepted values = 'discounted_price','all')
        * @param $manual_request boolean (Default value false: pass this as true for get discount even if there is no item in cart)
        * @param $is_cart boolean (Default value true)
        * @return array|float|int - is product has no discounts, returns $price;else return array of discount details based on $return_details
        */
    
        $price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $product->get_price(), $product->get_id(), 1, 0, 'discounted_price', 'true', 'true');
    
        if ($price == '')
        {
            $price = $product->get_price();
        }
    
        $currency_symbol = get_woocommerce_currency_symbol();
    
        // let's setup our div
        echo sprintf('<div id="product_total_price" style="margin-bottom:20px;">%s %s</div>', __('Product Total:', 'woocommerce'), '<span class="price">' . $currency_symbol . $price . '</span>');
    ?>
        <script>
            jQuery(function($) {
                // jQuery variables
                var price = <?php echo $price; ?>,
                    currency = '<?php echo $currency_symbol; ?>',
                    quantity = $('[name=quantity]').val();
    
                // Code to run when the document is ready
                var product_total = parseFloat(price * quantity);
                $('#product_total_price .price').html(currency + product_total.toFixed(2));
    
                // On change
                $('[name=quantity]').change(function() {
                    var quantity = this.value;
    
                    $.ajax({
                        url: '<?php echo admin_url('admin-ajax.php') ?>',
                        type: 'POST',
                        data: {
                            quantity: quantity,
    						action: 'dynamic_price'
                        },
                        success: function(data) {
                            //var price = data;
                            alert('yes');
                            alert(data);
                        }
                    });
    
                    if (!(this.value < 1)) {
                        product_total = parseFloat(price * this.value);
                        $('#product_total_price .price').html(currency + product_total.toFixed(2));
                    }
                });
            });
        </script>
    
    <?php
    }
    // We are going to hook this on priority 31, so that it would display below add to cart button.
    add_action('woocommerce_single_product_summary', 'action_woocommerce_single_product_summary', 31, 0);
    Thread Starter benventer83

    (@benventer83)

    Will you be able to send me an example please, never used it before.

    Thread Starter benventer83

    (@benventer83)

    add_action('wp_ajax_dynamic_price', 'get_update_dynamic_price_xyz');
    add_action('wp_ajax_nopriv_dynamic_price', 'get_update_dynamic_price_xyz');
    
    function get_update_dynamic_price_xyz()
    {
        global $product;
    
        /**
        * Get the discount details of given product with custom price
        * @param $price float/integer
        * @param $product object (Product object Example: wc_get_product($product_id))
        * @param $quantity int
        * @param $custom_price float/integer (0 for calculate discount from product price)
        * @param $return_details string (Default value 'discounted_price' accepted values = 'discounted_price','all')
        * @param $manual_request boolean (Default value false: pass this as true for get discount even if there is no item in cart)
        * @param $is_cart boolean (Default value true)
        * @return array|float|int - is product has no discounts, returns $price;else return array of discount details based on $return_details
        */
    	
        $qty = $_POST['quantity'];
        $price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $product->get_price(), $product->get_id(), $qty, 0, 'discounted_price', 'true', 'true');
    
        if ($price == '')
        {
            $price = $product->get_price();
        }
    
        echo $price;
    }
    
    function action_woocommerce_single_product_summary()
    {
        global $product;
    
        /**
        * Get the discount details of given product with custom price
        * @param $price float/integer
        * @param $product object (Product object Example: wc_get_product($product_id))
        * @param $quantity int
        * @param $custom_price float/integer (0 for calculate discount from product price)
        * @param $return_details string (Default value 'discounted_price' accepted values = 'discounted_price','all')
        * @param $manual_request boolean (Default value false: pass this as true for get discount even if there is no item in cart)
        * @param $is_cart boolean (Default value true)
        * @return array|float|int - is product has no discounts, returns $price;else return array of discount details based on $return_details
        */
    
        $price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $product->get_price(), $product->get_id(), 1, 0, 'discounted_price', 'true', 'true');
    
        if ($price == '')
        {
            $price = $product->get_price();
        }
    
        $currency_symbol = get_woocommerce_currency_symbol();
    
        // let's setup our div
        echo sprintf('<div id="product_total_price" style="margin-bottom:20px;">%s %s</div>', __('Product Total:', 'woocommerce'), '<span class="price">' . $currency_symbol . $price . '</span>');
    ?>
        <script>
            jQuery(function($) {
                // jQuery variables
                var price = <?php echo $price; ?>,
                    currency = '<?php echo $currency_symbol; ?>',
                    quantity = $('[name=quantity]').val();
    
                // Code to run when the document is ready
                var product_total = parseFloat(price * quantity);
                $('#product_total_price .price').html(currency + product_total.toFixed(2));
    
                // On change
                $('[name=quantity]').change(function() {
                    var quantity = this.value;
    
                    $.ajax({
                        url: '<?php echo admin_url('admin-ajax.php') ?>',
                        type: 'POST',
                        data: {
                            quantity: quantity,
    						action: 'dynamic_price'
                        },
                        success: function(data) {
                            //var price = data;
                            alert('yes');
                            alert(data);
                        }
                    });
    
                    if (!(this.value < 1)) {
                        product_total = parseFloat(price * this.value);
                        $('#product_total_price .price').html(currency + product_total.toFixed(2));
                    }
                });
            });
        </script>
    
    <?php
    }
    // We are going to hook this on priority 31, so that it would display below add to cart button.
    add_action('woocommerce_single_product_summary', 'action_woocommerce_single_product_summary', 31, 0);
    • This reply was modified 3 years, 3 months ago by benventer83.
    Thread Starter benventer83

    (@benventer83)

    Hi

    I have tried that, but lo luck, alert yes and alert data doesn’t return any values. Here is the code.

    $.ajax({
                        url: '<?php echo admin_url('admin-ajax.php') ?>',
                        type: 'POST',
                        data: {
                            quantity: quantity,
                            action: 'dynamic_price'
                        },
                        success: function(data) {
                            //var price = data;
                            alert('yes');
                            alert(data);
                        }
                    });
    Forum: Fixing WordPress
    In reply to: Xero Integration
    Thread Starter benventer83

    (@benventer83)

    Hi Steve

    Thank you for the list. I was hoping that one of the developers would see my post and confirm if this is possible. I will start contacting them individually thank you.

    Thread Starter benventer83

    (@benventer83)

    Please let me know when you replied to my ticket, the woocommerce support platform is not the best, I don’t even know how to find my ticket that I posted. So might miss your communication there.

    Thread Starter benventer83

    (@benventer83)

    It is a miracle, today my support dashboard worked for the first time ever. I have submitted the ticket so please be on the lookout.

    Thread Starter benventer83

    (@benventer83)

    I receive the following message when I want to get support.

    “In order to access this section of your account please verify your email address.”

    When I click on resend I don’t receive the mail to verify my email address. Have tried to logout and in again more than a 100 times with no luck. Not being able to make a support tick I have no way of getting help with this problem. Any suggestions?

    Thread Starter benventer83

    (@benventer83)

    Hi Madison

    Can you please send me the section where it gives detailed instructions on how to disconnect a xero organization an connect a new one. The link that you have send me does not say anything about changing organizations. Please supply as much detail as possible regarding the topic as this is a live system and I do not have much room for error.

    Also is it possible to have more than one xero organization connected to one woocommerce system?

    Regards

    Ben

    Thread Starter benventer83

    (@benventer83)

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://dbpharma.co.za
    Site address (URL): https://dbpharma.co.za
    WC Version: 5.8.0
    REST API Version: ? 5.8.0
    WC Blocks Version: ? 5.9.1
    Action Scheduler Version: ? 3.3.0
    WC Admin Version: ? 2.7.2
    Log Directory Writable: ?
    WP Version: 5.8.1
    WP Multisite: –
    WP Memory Limit: 256 MB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_ZA
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.4.25
    PHP Post Max Size: 32 MB
    PHP Time Limit: 60
    PHP Max Input Vars: 2500
    cURL Version: 7.52.1
    OpenSSL/1.0.2u
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.4.21-MariaDB-1:10.4.21+maria~stretch
    Max Upload Size: 32 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 5.8.0
    WC Database Prefix: wp_
    Total Database Size: 57.97MB
    Database Data Size: 38.33MB
    Database Index Size: 19.64MB
    wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_order_items: Data: 1.52MB + Index: 0.28MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 7.52MB + Index: 6.03MB + Engine InnoDB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_actions: Data: 0.25MB + Index: 0.39MB + Engine InnoDB
    wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_logs: Data: 0.22MB + Index: 0.16MB + Engine InnoDB
    wp_aiowps_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_aiowps_failed_logins: Data: 1.52MB + Index: 0.00MB + Engine InnoDB
    wp_aiowps_global_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_aiowps_login_activity: Data: 0.09MB + Index: 0.00MB + Engine InnoDB
    wp_aiowps_login_lockdown: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_aiowps_permanent_block: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 5.52MB + Index: 2.28MB + Engine InnoDB
    wp_failed_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_options: Data: 8.52MB + Index: 1.75MB + Engine InnoDB
    wp_postmeta: Data: 8.52MB + Index: 6.03MB + Engine InnoDB
    wp_posts: Data: 1.52MB + Index: 0.39MB + Engine InnoDB
    wp_queue: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_usermeta: Data: 0.33MB + Index: 0.30MB + Engine InnoDB
    wp_users: Data: 0.05MB + Index: 0.05MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.05MB + Index: 0.00MB + Engine InnoDB
    wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_coupon_lookup: Data: 0.09MB + Index: 0.11MB + Engine InnoDB
    wp_wc_order_product_lookup: Data: 1.52MB + Index: 0.80MB + Engine InnoDB
    wp_wc_order_stats: Data: 0.23MB + Index: 0.20MB + Engine InnoDB
    wp_wc_order_tax_lookup: Data: 0.14MB + Index: 0.14MB + Engine InnoDB
    wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    attachment: 45
    custom_css: 1
    flamingo_contact: 33
    flamingo_inbound: 49
    ml-slide: 1
    ml-slider: 1
    nav_menu_item: 16
    page: 13
    post: 6
    product: 136
    revision: 80
    shop_coupon: 21
    shop_order: 1975
    shop_order_refund: 11
    wpcf7_contact_form: 1
    wwp_requests: 9
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    Hide errors from visitors: ?
    
    ### Active Plugins (21) ###
    
    All In One WP Security: by Tips and Tricks HQ
    Peter Petreski
    Ruhul
    Ivy – 4.4.9
    
    Allow Multiple Accounts: by Scott Reilly – 3.0.4
    Classic Editor: by WordPress Contributors – 1.6.2
    Contact Form 7: by Takayuki Miyoshi – 5.5.2
    Chimney Rock - Inventory Manager: by Chimney Rock Software – 3.3.2
    Flamingo: by Takayuki Miyoshi – 2.2.2
    Homepage Control: by WooThemes – 2.0.3
    Import and export users and customers: by codection – 1.18.4.4
    Kadence WooCommerce Email Designer: by Kadence WP – 1.4.8
    MetaSlider: by MetaSlider – 3.23.0
    Really Simple SSL: by Really Simple Plugins – 5.1.2
    Simple Website Redirect: by Micah Wood – 1.2.8
    SOFT79 Expiry dates for WooCommerce PRO: by Soft79 – 1.3.8
    Change Storefront Footer Copyright Text: by QuadLayers – 1.0.9
    Title Toggle for Storefront Theme: by Wooassist – 1.2.4
    UpdraftPlus - Backup/Restore: by UpdraftPlus.com
    DavidAnderson – 1.16.63
    
    User Role Editor: by Vladimir Garagulya – 4.60.2
    Booster for WooCommerce: by Pluggabl LLC – 5.4.8
    Wholesale For WooCommerce: by wpexpertsio – 1.3.3
    WooCommerce Xero Integration: by WooCommerce – 1.7.33
    WooCommerce: by Automattic – 5.8.0
    
    ### Inactive Plugins (8) ###
    
    Akismet Anti-Spam: by Automattic – 4.2.1
    Facebook for WooCommerce: by Facebook – 2.6.5
    Hello Dolly: by Matt Mullenweg – 1.7.2
    Mailchimp for WooCommerce: by Mailchimp – 2.5.3
    Query Monitor: by John Blackbourn – 3.7.1
    Stop Spammers: by Trumani – 2021.19
    WooCommerce Admin: by WooCommerce – 2.7.2
    WooCommerce PayFast Gateway: by WooCommerce – 1.4.19
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: ZAR (R)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Shop base: #9 - /shop/
    Basket: #10 - /basket/
    Checkout: #11 - /checkout/
    My account: #12 - /my-account/
    Terms and conditions: ? Page not set
    
    ### Theme ###
    
    Name: Storefront
    Version: 3.9.1
    Author URL: https://woocommerce.com/
    Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build
    personally we recommend using a child theme. See: How to create a child theme
    
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: –
    
    ### Action Scheduler ###
    
    Complete: 776
    Oldest: 2021-10-01 16:41:50 +0200
    Newest: 2021-11-02 09:54:34 +0200
    
    ### Status report information ###
    
    Generated at: 2021-11-02 10:16:02 +02:00
    
    Thread Starter benventer83

    (@benventer83)

    I am using WooCommerce Xero Integration plugin

    Thread Starter benventer83

    (@benventer83)

    Any other inventory management plugins that can handle the above question for me to compare with ATUM?

Viewing 13 replies - 1 through 13 (of 13 total)