Forum Replies Created

Viewing 15 replies - 1 through 15 (of 29 total)
  • Thanks for the quick help and finding out that I had an old version of the Plus installed that collided.
    Also thanks for the quick fix on my other issue that came up.

    Mark

    Mark Krieger

    (@markcanada)

    Great πŸ™‚

    Great πŸ™‚
    …maybe even change the 168 hours to 7 days and so on…
    Thanks

    WooHoo. Hope it all works out for you πŸ™‚

    Mark Krieger

    (@markcanada)

    I changed ‘[yourtheme]/woocommerce-fixed-quantity/global/quantity-input.php’ as per the above link to the code below.
    It shows radio buttons on the product pages and still the dropdown in the cart to keep it a clean display (@habibillah – feel free to use the code with a setting to turn the radio buttons off/on in your plugin):

    <?php
    /**
     * Product quantity inputs
     *
     * This template can be overrided by copying it to yourtheme/woocommerce-fixed-quantity/global/quantity-input.php
     *
     * @var string $input_name
     * @var WC_Product $product
     * @var int $selected_quantity
     */
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    
    if (empty($product))
        global $product;
    
    $selected_quantity = !empty($selected_quantity)? $selected_quantity : '';
    
    $data = WoofixUtility::isFixedQtyPrice($product);
    ?>
    <div class="quantity_select">
    
        <?php
        if (!is_cart()) {
            do_action('woofix_before_quantity_input');
        }
        
        if (!is_cart()) {
            ?><div id="fq_qty_radio">
            <?php foreach ($data['woofix'] as $item): 
                $woofix_price = $item['woofix_price'];
                $woofix_qty = $item['woofix_qty'];
                $woofix_disc = $item['woofix_disc'] . '%';
                $price = wc_price($woofix_price);
                $total = wc_price($woofix_price * $woofix_qty);
        
                $woofix_desc = !empty($item['woofix_desc'])? $item['woofix_desc'] : WOOFIXCONF_QTY_DESC;
                $description = str_replace(
                    array('{qty}', '{price}', '{total}', '{discount}', ' '),
                    array($woofix_qty,  $price, $total, $woofix_disc, '&nbsp;'),
                    $woofix_desc
                );
                if ( empty ( $selected_quantity )) $selected_quantity = $woofix_qty; ?>
        
                <label for="<?php echo 'wqid.'.$woofix_qty; ?>"><input type="radio" name="<?php echo esc_attr( $input_name ); ?>" value="<?php echo $woofix_qty; ?>" id="<?php echo 'wqid.'.$woofix_qty; ?>" data-qty="<?php echo $woofix_qty; ?>" data-price="<?php echo $woofix_price; ?>" <?php echo ($selected_quantity == $woofix_qty)? "checked" : ""; ?>> <?php echo $description; ?></label><BR />
        
            <?php endforeach; ?>
            </div>
            <?php
        } else {
            ?>
        
            <select name="<?php echo esc_attr( $input_name ); ?>"
                    title="<?php _ex( 'Qty', 'Product quantity input tooltip', 'woofix' ); ?>"
                    class="qty">
                <?php foreach ($data['woofix'] as $item): ?>
        
                    <?php
                    $woofix_price = $item['woofix_price'];
                    $woofix_qty = $item['woofix_qty'];
                    $woofix_disc = $item['woofix_disc'] . '%';
                    $price = wc_price($woofix_price);
                    $total = wc_price($woofix_price * $woofix_qty);
        
                    $woofix_desc = !empty($item['woofix_desc'])? $item['woofix_desc'] : WOOFIXCONF_QTY_DESC;
                    $description = str_replace(
                        array('{qty}', '{price}', '{total}', '{discount}', ' '),
                        array($woofix_qty,  $price, $total, $woofix_disc, '&nbsp;'),
                        $woofix_desc
                    );
                    ?>
        
                    <option value="<?php echo $woofix_qty; ?>"
                            data-qty="<?php echo $woofix_qty; ?>"
                            data-price="<?php echo $woofix_price; ?>" <?php echo ($selected_quantity == $woofix_qty)? "selected" : ""; ?>>
                        
                        <?php echo $description; ?>
                    </option>
        
                <?php endforeach; ?>
            </select>
        
            <?php
        }
        
        if (!is_cart()) {
            do_action('woofix_after_quantity_input');
        }
        ?>
    
    </div>
    

    Hi George

    Thanks for the info. I understand that you probably have other things to do but wanted to make sure that you are aware and planning to deal with what’s happening when IPv6 rolls out further.
    The filter thing is interesting. I haven’t done any work with filters but am familiar with some WordPress programming. Let’s see who finds the time first πŸ˜‰

    Thanks for the great plugin
    Mark

    Hi George

    Yes, you understood correctly. It’s too bad you don’t plan on including that soon.
    Our ISP gives a permanent IPv6/56 subnet to our router and when a computer connects to it one of those public IPv6 addresses is handed out to each computer at the time.
    It’s just a different one each time.
    So every time a new network connection is established we need to add/change the IPv6 address to the exclusion to see the site in a non-logged-in state if we work on functionality that is different for not logged in users.
    Also – because of this we can not exclude our clients’ IPv6 address so they can easily preview the site if they are on IPv6.

    Mark

    Hi Damian

    I just looked it up and the ‘[]’ syntax is supported starting in PHP 5.4 which your plugin shows as minimum requirement so it should work.
    But I can see the problem when you don’t actually program the PHP part yourself. There is no real way of knowing if that fix may break something else without going through the code and look at all the calls.

    So I took another approach and tested it on on of my my sites. It takes more code but has less consequences. You can probably run that piece of code through your programmers fairly quickly and cheaply:

    In “/css-javascript-toolbox/framework/events/subjects/hook.subject.php” lines 81-82 are now

    add_action($this->getHookName(), array(&$this, 'trigger'), 10, count($this->getDefinition('parameters')));
    add_action($this->getInstanceHookName(), array(&$this, 'trigger'), 10, count($this->getDefinition('parameters')))

    If you replace that with the following lines you should have a minimally invasive fix:

    $cntParams = is_null ( $this->getDefinition('parameters') ) ? 0 : count($this->getDefinition('parameters'));
    add_action($this->getHookName(), array(&$this, 'trigger'), 10, $cntParams);
    add_action($this->getInstanceHookName(), array(&$this, 'trigger'), 10, $cntParams);

    They should be able to confirm that this doesn’t have unintended consequences fairly quickly.

    As for the long term future – not sure about the funding for fixes unless you give up on the pro subscriptions, but funding for (extensive) new features sounds better than giving up on this software. It’s just a shame that they are now two plugins to maintain. That adds to the cost.

    The best for you and your software
    Mark

    WooHoo

    Oh darn. So sorry. I thought I read standard, not floating.
    Make it a feature request then please πŸ™‚

    Hi Damian

    Let’s start with nnnoooooooooooooo – I don’t want to try to find any other tool. Yours works well.

    Now to the error problem here. The solution @stchris posted at https://wordpress.org/support/topic/php-warning-177/ works for me.
    It looks like PHP 7.2 now spits out an error message when trying to COUNT on NULL as per https://www.php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types
    Chris sets it to an empty array instead of NULL, so that should work without impacting anything, right?
    Or should it be array() instead of [] for older PHP compatibility? I am not that good in PHP and haven’t looked at the minimum requirements for your code.
    Please at least still push this change through as an update until you decide what to do in the future.

    PHP7.1 is only on security updates now and the only actively developed branches are 7.2 7.3 – http://php.net/supported-versions.php
    Could we please get the fix? Even if that’s the only update coming for the next release?

    OK. Reporting back:
    WooCommerce Simple Product, Downloadable with one file added, Attributes changed, WooCommerce Booster provides 1 custom tab and All in One SEO.
    All seems fine and orders still linked πŸ™‚

    Mark Krieger

    (@markcanada)

    Hi @microtribe

    Glad that my plugin is working out for you.

    Regarding your question about WooCommerce downlod handling I am going from memory here and it has been a bit since I looked at how their system internally works. If I am getting it wrong, somebody else please chime in here.
    For deletions the download file is just removed from the product’s available files database and the download permissions for each order stay intact. So just one database entry is removed. When a user goes to the downloads page then the system looks for all the files the user has access to and just ignores the ones it doesn’t find any more or for which access is expired.
    For file changes the system now just changes one entry in the file table with the new file and location and the user’s downloads page then shows the new file since it has the same ID now that the old one had. (Download access is granted by ID – every file entry has a unique ID).
    When adding new files one way or another new download permissions have to be created for this file (for every order that has this product/file in it). The download permissions are stored separately of the product orders to accommodate download limitations on a per product and file basis. Each order->file has its own entry in the database. That’s why it takes a lot more processing and database changes.

    Hi didoulr

    We ran into the same problem that we wanted to grant access for new product files to past orders that expire at the same time as the files from the original orders.

    After a lot of searching I finally broke down and developed a plugin that allows us to copy the permissions from one file to another.
    We offer it for sale at https://www.makbiz.ca/shop/wordpress-plugins/mak-woocommerce-download-permissions/ for anyone who has the same issues.

    All the best
    Mark

Viewing 15 replies - 1 through 15 (of 29 total)