Forum Replies Created

Viewing 15 replies - 76 through 90 (of 97 total)
  • Hello, we also recognized this behaviour.
    Isn’t it possible to delete this cookie automatically before user switching?

    It is very irritating for the client, when he finds products in the cart he didn’t put in there, when an admin or assistant didn’t delete his cart before switching.

    Thread Starter Apfelbiss

    (@apfelbiss)

    Hello.

    1. This is the situation at the beginning with correct URL, when there was no SEO editing:
    https://img4.picload.org/image/roplpioa/wp_custompermalinks_yoastseo_1.png

    2. After editing the SEO, e.g. the meta description:
    https://img4.picload.org/image/roplpior/wp_custompermalinks_yoastseo_2.png

    3. After a second editing:
    https://picload.org/image/roplpiaw/wp_custompermalinks_yoastseo_3.png

    The URL shown at “Permalink” (and at Yoast SEO slug) is the URL as it is actually seen in the browser when viewing the product/post.

    With every new SEO edit the URL gets longer and longer, when not editing the SEO slug (e.g. deleting it so that it’s auto-generated by WordPress)

    I don’t understand your second question. Maybe it’s already answered with the screenshots?
    Relating to your third question: The URL after a first SEO edit for the “SEO” product would be “/product/productseo/”.

    • This reply was modified 7 years, 9 months ago by Apfelbiss.

    Hi, I have had the same problem. After changing a little piece of code as mentioned here it works ??

    I hope it will be fixed in the next update soon.

    • This reply was modified 7 years, 10 months ago by Apfelbiss.
    • This reply was modified 7 years, 10 months ago by Apfelbiss.
    Thread Starter Apfelbiss

    (@apfelbiss)

    Thak you, now it works ??

    Thread Starter Apfelbiss

    (@apfelbiss)

    This is the actual code (“farbe” ist the selected variation, which works fine in the output):

    add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
    
    function my_custom_tracking( $order_id ) { 
    
    $order = wc_get_order( $order_id ); ?>
    
    <script type="text/javascript" src="tracking.js"></script>
    <script type="text/javascript">
    var order = kswp.purchaseTracking.createOrder();
    order.purchasetotal = <?php echo $order->get_subtotal(); ?>;
    order.currency = 'EURO';
    <?php $counter = 0;
    		$items = $order->get_items();
    		foreach ($items as $key => $item) {
    			$product = $item['data'];
    			$counter++; ?>
    order.sku<?php echo $counter; ?> = '<?php echo $product->get_sku(); ?>';
    order.name<?php echo $counter; ?> = '<?php echo $item['name'] . ', ' . $item['farbe']; ?>';
    order.unitprice<?php echo $counter; ?> = <?php echo $order->get_item_total( $item ); ?>;
    order.qty<?php echo $counter; ?> = <?php echo $item['qty']; ?>;
    <?php } ?>
    </script>
    
    <?php } ?>
    Thread Starter Apfelbiss

    (@apfelbiss)

    Thank you, now Title, Price and Quantity are working ??

    Only the SKU isn’t working, because with $product->get_sku(); I only get the error:

    Call to a member function get_sku() on null

    Thread Starter Apfelbiss

    (@apfelbiss)

    Sorry for my late reply. Last days I thought that the tracking script is not needed any more, therefore I had to clarify the situation. But that was only a missunderstanding.

    As I described in my last post, even with $product the behaviour is the same, the item details are still empty:

    add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
    
    function my_custom_tracking( $order_id ) { 
    
    $order = wc_get_order( $order_id ); ?>
    
    <script type="text/javascript" src="tracking.js"></script>
    <script type="text/javascript">
    var order = kswp.purchaseTracking.createOrder();
    order.purchasetotal = <?php echo $order->get_subtotal(); ?>;
    order.currency = 'EURO';
    <?php $counter = 0;
    		$items = $order->get_items();
    		foreach ($items as $key => $product) {
    			$counter++; ?>
    order.sku<?php echo $counter; ?> = '<?php echo $product['sku']; ?>';
    order.name<?php echo $counter; ?> = '<?php echo $product['title']; ?>';
    order.unitprice<?php echo $counter; ?> = <?php echo $product['price']; ?>;
    order.qty<?php echo $counter; ?> = <?php echo $product['quantity']; ?>;
    <?php } ?>
    </script>
    
    <?php } ?>

    At $order->get_subtotal( $item ); I only removed the $item, because we want to get the total without VAT and coupons.

    Thread Starter Apfelbiss

    (@apfelbiss)

    We have got some medical products in WooCommerce where we have to use them, e.g. in “O<sub>2</sub>”.

    Is there no possibility to remove them in the mails now or to make it work in a future version?

    Thread Starter Apfelbiss

    (@apfelbiss)

    Big thanks for the link and thanks also for the help so far.

    Is there any documentation for the correct notations to get the needed details via PHP? Or is it maybe possible to get more concrete assistance?

    Last days I got the information, that this now should be implemented via JavaScript and not via image. With the following code the foreach and the counter are working, but the item details aren’t added and I can’t find any error message (even with $key or $product instead of $item).

    add_action( 'woocommerce_thankyou', 'my_custom_tracking' );
    
    function my_custom_tracking( $order_id ) { 
    
    $order = wc_get_order( $order_id ); ?>
    
    <script type="text/javascript" src="tracking.js"></script>
    <script type="text/javascript">
    var order = kswp.purchaseTracking.createOrder();
    order.purchasetotal = <?php echo $order->get_subtotal( $item ); ?>;
    order.currency = 'EURO';
    <?php $counter = 0;
    		$items = $order->get_items();
    		foreach ($items as $key => $product) {
    			$counter++; ?>
    order.sku<?php echo $counter; ?> = '<?php echo $item['sku']; ?>';
    order.name<?php echo $counter; ?> = '<?php echo $item['title']; ?>';
    order.unitprice<?php echo $counter; ?> = <?php echo $item['price']; ?>;
    order.qty<?php echo $counter; ?> = <?php echo $item['quantity']; ?>;
    <?php } ?>
    </script>
    
    <?php } ?>
    Thread Starter Apfelbiss

    (@apfelbiss)

    Ok, that’s my fault. I only copied the code from checkout/thankyou.php into order/order-details.php (and adjusted it a little bit) for testing, but I thought that it would be better to integrate this into the thankyou.php, because it should be only generated on the “Thank you” page. If it’s only possible in the order-details.php, probably it has to be wrapped into an if-query.

    But even with “$item” the image link remains the same. I guess this issue is too difficult to implement with my level of knowledge in PHP.

    Thread Starter Apfelbiss

    (@apfelbiss)

    After changing this line in order/order-details.php to …
    $items = $order->get_items();

    … there is only this message in the content area:

    <h1>Error thrown</h1>
    <p>Call to a member function get_sku() on null</p>

    After changing the code into …

    <?php date_default_timezone_set('Europe/Berlin');
    global $product;
    if ( get_query_var('referrerid') != '' ) { $referrerid = get_query_var('referrerid'); $_SESSION['referrerid'] === $referrerid; }; if(isset($_SESSION['referrerid'])) { $sess_referrerid = $_SESSION['referrerid']; } ?>
    
    <img alt="." src="https://externalhost.xyz/tracking.gif?referrerid=<?php echo $sess_referrerid; ?>&date=<?php echo date('Y-m-d'); ?>%20<?php echo date('h:ia'); ?>&purchaseTotal=<?php echo $order->get_subtotal( $item ) ?><?php
    		$counter = 0;
    		$items = $order->get_items();
    			foreach ($items as $item) {
    			$counter++;
    			$_product     = apply_filters( 'woocommerce_order_item_product', $order_item['data'], $order_item, $order_item_key );
    			$product_id   = apply_filters( 'woocommerce_order_item_product_id', $order_item['product_id'], $order_item, $order_item_key );
    			$manufacturer = wp_get_post_terms( $_product->id, $attribute['name'], 'pa_hersteller' );
    
    			?>&p<?php echo $counter; ?>=sku=<?php echo $order_item['sku']; ?>;singlePrice=<?php echo $order_item['price']; ?>;qty=<?php echo $order_item['quantity']; } ?>" style="width:1px; height:1px" />

    … this error message is gone and the GIF is not cutted anymore, but it’s still empty:
    <img style="width:1px; height:1px" src="https://externalhost.xyz/tracking.gif?referrerid=&date=2016-03-10%2003:31pm&purchaseTotal=78.5&p1=sku=;singlePrice=;qty=&p2=sku=;singlePrice=;qty=" alt=".">

    Thread Starter Apfelbiss

    (@apfelbiss)

    Sorry, I didn’t see that there was a warning, hidden in the IMG tag.

    Only the first tracking image (checkout/thankyou.php) is replaced* with the message above, in the second image (only for testing, order/order-details.php) there is the hidden warning:

    <img style="width:1px; height:1px" src="https://externalhost.xyz/tracking.gif?referrerid=&date=2016-03-09%2012:26pm&purchaseTotal=78.5<br /> <b>Warning</b>: Invalid argument supplied for foreach() in <b>/Applications/MAMP/htdocs/wpksonline/wp-content/themes/wpksblog/woocommerce/order/order-details.php</b> on line <b>74</b><br /> " alt=".">

    This is line 74:
    foreach ($order_items as $item_id => $item) {

    After deleting the line if (!session_id()) { session_start(); }; the warning message is gone, but nothing else changed. Not the link and also not the hidden warning message inside the second tracking image. But at the end only one of them has to work, preferably the one in the thankyou.php.

    * It’s not really replaced, it only looks like it, because the tracking image is now under the warning message, but with debug on the alt text (a simple dot) for the (because of testing) non-existing image is not shown.

    Thread Starter Apfelbiss

    (@apfelbiss)

    After enabling WP_DEBUG the “order received” page shows (instead of the tracking.gif):

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php:26) in /Applications/MAMP/htdocs/wpksonline/wp-content/themes/wpksblog/woocommerce/checkout/thankyou.php on line 59

    Above the regular page I get (on every page):

    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AjaxThumbnailRebuild has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/ajax-thumbnail-rebuild/ajax-thumbnail-rebuild.php on line 26
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CPTO has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/post-types-order/include/cpto-class.php on line 3
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; RE_Log has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/redirection/models/log.php on line 3
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; RE_404 has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/redirection/models/log.php on line 140
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Red_Match has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/redirection/models/match.php on line 3
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Red_Action has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/redirection/models/action.php on line 3
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Red_Item has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/plugins/redirection/models/redirect.php on line 3
    
    Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; pippin_recent_posts has a deprecated constructor in /Applications/MAMP/htdocs/wpksonline/wp-content/themes/kickstart/inc/plugin/widgets/recent-posts-widget.php on line 15

    FYI: “wpksblog” is a child theme from Kickstart.

    Thread Starter Apfelbiss

    (@apfelbiss)

    Thank you.

    Is this the complete JavaScript? Because I tested it at a local test installation and nothing happens. Even when I wrap a $(document).ready(function() around. But the JS-file is added correct into the header via:

    add_action( 'wp_enqueue_scripts', 'ks_js_variationproduct' );
    
    function ks_js_variationproduct() {
    if ( is_product() ) {
      wp_register_style( 'ks-variation-visibility', get_stylesheet_directory_uri() . '/js/ks-variation-visibility.js');
      wp_enqueue_style( 'ks-variation-visibility' );
    } else {
        // Returns false
    }
    }

    The content of the new JS file:

    $(document).ready(function() {
    	$single_variation = jQuery( '.single_variation' );
    
    $single_variation.on( 'show_variation', function() {
      jQuery( '.product-meta' ).show();
    });
    
    $single_variation.on( 'hide_variation', function() {
      jQuery( '.product-meta' ).hide();
    });
    
    });

    PS: We cannot use product ID (I think you mean “post_parent”) instead of SKU, because the product ID is only known after import of the parent products. But parent products and variations are prepared at the same time, therefore that wouldn’t work for us.

    Thread Starter Apfelbiss

    (@apfelbiss)

    For me even the button design in Storefront template isn’t greyed out enough to see that it’s disabled.

    As I described above, the display: none doesn’t work anymore for the “single_variation_wrap” div, only for “single_variation” div.

    That the Cart button is displayed always isn’t so bad, but in combination with the Gravity Forms Product Add-ons it’s too much information for the user if visiting the product page the first time (and you have to scroll much more to get the main text).

    It would be nice to get the Gravity Form hidden, if no variation is selected, but I think this is a question for the WooThemes support, because it’s a charged plugin.

Viewing 15 replies - 76 through 90 (of 97 total)