• Resolved curiositykillsthecat

    (@curiositykillsthecat)


    My theme is so heavily customised that the plugin options didn’t appear. I switched to a clean theme, and see that it is attached to the “add to cart” button? How do I unhook it from its current position, and hook it to woocommerce_template_loop_price?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter curiositykillsthecat

    (@curiositykillsthecat)

    Update:

    Ignore the last sentence of my initial post.

    What I want is to have Price and your plugin’s Options on the archive loop.

    So I moved woocommerce_template_single_add_to_cart to the loop. But the Options do not appear there. I thought maybe it only affect woocommerce_template_single_price, so I moved that to the loop as well. The Options are still not appearing on the loop.

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    It is attached to “woocommerce_before_add_to_cart_button” action in the file:
    wp-content/plugins/product-options-for-woocommerce/Controller/Product.php

    And it works only for single product page.

    If you want to use it in a loop you should use code like this:

    
    <?php
     include_once(Pektsekye_PO()->getPluginPath() . 'Model/Option.php');		
     $poOptionModel = new Pektsekye_ProductOptions_Model_Option();
    ?>
    
    <?php
    foreach($products as $productId){
      $options = $poOptionModel->getProductOptions($productId);
      foreach ($options as $option){
        echo htmlspecialchars($option['title']);
        foreach($option['values'] as $value){
          echo htmlspecialchars($value['title']);
          echo $value['price'];                 
        }      											                                                    
      }
    }
    ?>
    

    Stanislav

    Thread Starter curiositykillsthecat

    (@curiositykillsthecat)

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Moving the options’ is closed to new replies.