Title: muttly's Replies | WordPress.org

---

# muttly

  [  ](https://wordpress.org/support/users/muttly/)

 *   [Profile](https://wordpress.org/support/users/muttly/)
 *   [Topics Started](https://wordpress.org/support/users/muttly/topics/)
 *   [Replies Created](https://wordpress.org/support/users/muttly/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/muttly/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/muttly/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/muttly/engagements/)
 *   [Favorites](https://wordpress.org/support/users/muttly/favorites/)

 Search replies:

## Forum Replies Created

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

1 [2](https://wordpress.org/support/users/muttly/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/muttly/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] New Customer analytics not accurate](https://wordpress.org/support/topic/new-customer-report-not-accurate/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/new-customer-report-not-accurate/#post-17531853)
 * sorry for the delay in responding, I was away for a few days.
 * This did eventually work although once I deleted the old info I imported it again
   and it still wasn’t complete. I’ve ran it about 5 times in total but not deleting
   the existing data and eventually all the data is there.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity PDF] Custom Paper, page orintation](https://wordpress.org/support/topic/custom-paper-page-orintation/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-paper-page-orintation/#post-16004841)
 * Sorry I should have explained further to the above, I meant in terms of the page
   orientation I could not get it right to match up width and height as expected.
 * I have adapted my code to get the image displaying correctly but I’m using pixels
   rather than mm and forcing it the way I need.
 * Would you have an email address I can send my zipped php file to? I can also 
   include a screen shot of the settings I’m using. Maybe I’m doing something wrong
   but if I am, I can’t see it.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity PDF] Custom Paper, page orintation](https://wordpress.org/support/topic/custom-paper-page-orintation/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/custom-paper-page-orintation/#post-15991520)
 * Sorry for the delay.
 * I am using 6.4.6. My settings within the PDf section are set to:
    Paper Size:
   Custom Paper Size Width: 216 Height: 211 Unit: mm Paper Orientation: Landscape
 * DPI is set to 300, format is “Standard”
 * I’ve exported a test file and when exported I get width 211mm and height 216mm.
   As part of this design I need to place an image of the same dimensions within
   the pdf output. No matter what way I set it I cannot get it to output correctly.
 * Is there some sort of output I can provide to help with this issue?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity PDF] Name a PDF the woocommerce order number](https://wordpress.org/support/topic/name-a-pdf-the-woocommerce-order-number/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/name-a-pdf-the-woocommerce-order-number/#post-12427009)
 * Thank you for the help. I’ve since changed direction and I’m using the GFAPI 
   to set it on order completion.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Remove hidden product from pdf](https://wordpress.org/support/topic/remove-hidden-product-from-pdf/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/remove-hidden-product-from-pdf/#post-12426558)
 * That is perfect, thank you very much for your help!!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Remove hidden product from pdf](https://wordpress.org/support/topic/remove-hidden-product-from-pdf/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/remove-hidden-product-from-pdf/#post-12419116)
 * This is the code I use to add the products to the cart….
 * /**
    * Automatically adding the product to the cart. */
 * add_action(‘template_redirect’, ‘pt_add_wallet_to_cart’);
 * function pt_add_wallet_to_cart(){// $item_key, $product_id ) {
 *  $product_category_id = 508; // ticket category id
    $free_product_id = 37913;//
   Ticket Wallet Stock product id
 *  if( is_cart() || is_checkout() ) {
    //Remove all variations <– foreach (WC()-
   >cart->get_cart() as $cart_item_key => $cart_item) { $p_id = $cart_item[‘product_id’];
   $v_id = $cart_item[‘variation_id’]; if($p_id==$free_product_id){ if ($cart_item[‘
   variation_id’] == $v_id) { //remove single product WC()->cart->remove_cart_item(
   $cart_item_key); } } } //–> Remove all varations
 *  //Add variations <–
    foreach ( WC()->cart->get_cart() as $cart_item_key => $
   cart_item){ // Loop through all products $p_id = $cart_item[‘product_id’]; $terms
   = get_the_terms( $p_id, ‘product_cat’ ); $cat_found=false; foreach ( $terms as
   $term ) { // Loop through all categories $cat_id = $term->term_id; if($cat_id
   ==$product_category_id){ // If find product_category_id then break out $cat_found
   =true; break; } } $quantity = $cart_item[‘quantity’]; // Get quantity of this
   item $pa_tbs = $cart_item[‘variation’][‘attribute_pa_top-bar-style’]; // Get 
   top bar style
 *  $pa_c = $cart_item[‘variation’][‘attribute_pa_colour’]; // Get top bar colour
   
   $pa_c=str_replace(‘-nc’,”,$pa_c); // Remove -nc from colour attribute
 *  $pa_ht = $cart_item[‘variation’][‘attribute_pa_home-team’]; // Get home team
   
   $pa_w = $cart_item[‘variation’][‘attribute_pa_wallet’]; // Get wallet
 *  if($pa_tbs==”){
    $pa_tbs=’youre-going-to’; } if($pa_c==”){ $pa_c=’white’; }
 *  $taxonomy = ‘pa_top-bar-style’; // Get name rather than slug
    $t = get_term_by(‘
   slug’, $pa_tbs, $taxonomy); $pa_tbs_fv = $t->name;
 *  $taxonomy = ‘pa_colour’; // Get name rather than slug
    $t = get_term_by(‘slug’,
   $pa_c, $taxonomy); $pa_c_fv = $t->name;
 *  $free_variation=array( // Create array of names of attributes
    ‘Top Bar Style’
   => $pa_tbs_fv, ‘Colour’ => $pa_c_fv, ); $vx=get_variation_id_from_attributes(
   $free_product_id,$pa_tbs,$pa_c); // Retrieve variation id //echo ‘<br><br>cat_found:‘.
   $cat_found.'<br>cat_id: ‘.$cat_id.'<br>p_id: ‘.$p_id.'<br>tbs: ‘.$pa_tbs.'<br
   >tbs_fv: ‘.$pa_tbs_fv.'<br>c: ‘.$pa_c.'<br>c_fv: ‘.$pa_c_fv.'<br>w: ‘.$pa_w.'
   <br>ht: ‘.$pa_ht.'<br>vx: ‘.$vx; if($pa_w == ‘included’){ // If wallet is ‘included’
   add product to cart WC()->cart->add_to_cart($free_product_id, $quantity, $vx,
   $free_variation); } } //–> Add variations } }
 * function get_variation_id_from_attributes( $product_id, $topbarstyle, $colour){
 *  $topbarstyle = strtolower($topbarstyle);
    $colour = strtolower($colour);
 *  $variation_id = find_matching_product_variation_id ( $product_id, array(
    ‘attribute_pa_top-
   bar-style’ => $topbarstyle, ‘attribute_pa_colour’ => $colour ));
 *  return $variation_id;
    }
 * function find_matching_product_variation_id($product_id, $attributes){
    return(
   new \WC_Product_Data_Store_CPT())->find_matching_product_variation( new \WC_Product(
   $product_id), $attributes ); }
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Remove hidden product from pdf](https://wordpress.org/support/topic/remove-hidden-product-from-pdf/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/remove-hidden-product-from-pdf/#post-12418669)
 * I’m doing it via code. I am however using these 2 code snippets to hide them 
   from the cart, cart count and emails. The customer doesn’t know about the product.
   I can include my code for adding the items if you want. But ideally just not 
   including a hidden product would work well. It’s the only hidden product I have
   on the site and it’s use is solely for stock keeping.
 * [https://businessbloomer.com/woocommerce-hide-hidden-products-cart-order-emails/](https://businessbloomer.com/woocommerce-hide-hidden-products-cart-order-emails/)
 * [https://businessbloomer.com/woocommerce-exclude-hidden-products-from-mini-cart-counter/](https://businessbloomer.com/woocommerce-exclude-hidden-products-from-mini-cart-counter/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Gravity PDF] Name a PDF the woocommerce order number](https://wordpress.org/support/topic/name-a-pdf-the-woocommerce-order-number/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/name-a-pdf-the-woocommerce-order-number/#post-12336852)
 * Thank you, I will take a look. Where should I be putting that code?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Custom Fonts Not Working](https://wordpress.org/support/topic/custom-fonts-not-working-3/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/custom-fonts-not-working-3/#post-10769218)
 * Thank you! Thank you! Thank you!!
 * It was the CSS. I removed the section above and it was displaying the fonts correctly.
   its taken another 30 minutes to get the logo right but its done now. Thank you
   so much!!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Custom Fonts Not Working](https://wordpress.org/support/topic/custom-fonts-not-working-3/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/custom-fonts-not-working-3/#post-10768799)
 * I cleared the suggested folder and it made no difference.
 * I’ve called the pdf 3 different ways.
    1. From the orders page, I’m ticking the
   order I want to print and selecting “PDF Packing Slip” from the drop down at 
   the top left and click Apply. 2. From the orders page, I’ve clicked the “PDF 
   Packing Slip” box in the actions box. 3. In the actual order, I’ve clicked the“
   PDF Packing Slip” in the right side of the screen.
 * All 3 options work when in Output to HTML but not as PDF.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Custom Fonts Not Working](https://wordpress.org/support/topic/custom-fonts-not-working-3/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/custom-fonts-not-working-3/#post-10768312)
 * I’ve just tried this and its still not working in pdf mode. When i do it in output
   to html it works fine.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Hide specific product meta](https://wordpress.org/support/topic/hide-specific-product-meta/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/hide-specific-product-meta/#post-10767321)
 * That works perfectly, thank you very much!!
 * Just for anyone else using it, you wan to use the “Name” of the attribute you
   want to hide, not the “slug”.
    -  This reply was modified 7 years, 7 months ago by [muttly](https://wordpress.org/support/users/muttly/).
      Reason: Added note about using name rather than slug
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Custom Fonts Not Working](https://wordpress.org/support/topic/custom-fonts-not-working-3/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/custom-fonts-not-working-3/#post-10767286)
 * The temp folders are writable.
 * To test I’ve also changed “Output to HTML” and the fonts generate correctly there.
   I have also checked the font files I’m using and they are embedded to PDF. I 
   will forward the template and fonts to the address provided, thank you.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[PDF Invoices & Packing Slips for WooCommerce] Custom Fonts Not Working](https://wordpress.org/support/topic/custom-fonts-not-working-3/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/custom-fonts-not-working-3/#post-10763123)
 * I’ve made several more attempts with this and while it works fine in the test.
   php
 * It still does not work on the pdf generating file.
 * I’ve moved the location of the file linked originally, it is now here.
    [https://pretendtickets.com/28n042di0plzc6tv8jqgk9499kf52dmi/wp-content/themes/flatsome-child/woocommerce/pdf/PretendTickets/test.php](https://pretendtickets.com/28n042di0plzc6tv8jqgk9499kf52dmi/wp-content/themes/flatsome-child/woocommerce/pdf/PretendTickets/test.php)
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Olsen Light] Comments Secction Issue with Facebook](https://wordpress.org/support/topic/comments-secction-issue-with-facebook/)
 *  Thread Starter [muttly](https://wordpress.org/support/users/muttly/)
 * (@muttly)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/comments-secction-issue-with-facebook/#post-10462201)
 * That worked perfectly. Thank you!

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

1 [2](https://wordpress.org/support/users/muttly/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/muttly/replies/page/2/?output_format=md)