Forum Replies Created

Viewing 15 replies - 16 through 30 (of 119 total)
  • Thread Starter bolide

    (@bolide-1)

    That is the plugin. It’s effectively unsupported. It works well but line breaks in tabs are not respected so it’s pretty useless

    I have all my tabs setup & working, just need a better plugin to deploy them

    bolide

    (@bolide-1)

    Count me amongst the people who are incredulous that Woocommerce doesn’t contain a simple way to activate a sale

    I would have expected a checkbox to turn the sale on & off, perhaps with a timed function like scheduling a post. Having to edit all the products to enable a sale runs absolutely counter to the ease with which Woocommerce works

    What happens when you make a test purchase yourself? Can you repeat the fault?

    Possibly the customer didn’t register with the site and made a purchase without registering. This is possible if you have Woocommerce setup to not force customers to register

    The solution long-term is probably to force buyers to register

    The solution for this purchase is for you to register for the customer in his name then link the account with his order. He will then be able to login once you give him the username & password

    Thread Starter bolide

    (@bolide-1)

    Coming along nicely. I’d like to flag which items are out of stock. I edited the child functions.php to try to add the “availability” flag.

    Looks OK, doesn’t throw any errors and it produces a table cell where I’d expect to find the ‘availability’ flag. But the cell is empty

    Any suggestions?

    I now have

    <?php
    //add action give it the name of our function to run
    add_action( 'woocommerce_after_shop_loop_item_title', 'wcs_stock_text_shop_page', 25 );
    //create our function
    function wcs_stock_text_shop_page() {
        //returns an array with 2 items availability and class for CSS
        global $product;
        $availability = $product->get_availability();
        //check if availability in the array = string 'Out of Stock'
        //if so display on page.//if you want to display the 'in stock' messages as well just leave out this, == 'Out of stock'
        if ( $availability['availability'] == 'Out of stock') {
            echo apply_filters( 'woocommerce_stock_html', '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability['availability'] ) . '</p>', $availability['availability'] );
        }
        
    }
    
      // Shortcode to make a list of products from a category
      // usage: [products_list rows="-1" category="kits" orderby="title" order="ASC"]
      // rows defaults to -1, show all products
      // category defaults to '', empty: shows all categories, value: category slug
      // orderby defaults to 'title'
      // order defaults to 'DESC'
      // for orderby options see: https://codex.www.ads-software.com/Template_Tags/get_posts
      // code goes in functions.php for your child theme
    
      add_shortcode('products_list', 'products_list');
      function products_list( $atts ) {
        global $post;
        // get the parameters
        $args = shortcode_atts( array(
    	  'rows'	        => -1,
    	  'category'	    => '',
          'tag'             => '',
          'orderby' 		=> 'title',
          'order'           => 'ASC'
    	  ), $atts );
        $rows = (int) $args['rows'];
        $category = $args['category'];
        $tag = $args['tag'];
        $orderby = $args['orderby'];
        $order = $args['order'];
        $availability = $args['availability'];
        // get the products
        $args = array(
    	  'posts_per_page'	=> $rows,
    	  'offset'          => 0,
    	  'post_status'     => 'publish',
    	  'post_type'      	=> 'product',
    	  'product_cat' 	=> $category,
          'product_tag'     => $tag,
    	  'orderby' 		=> $orderby,
          'order'			=> $order,
          'availability'    => $availability,
        );
        $posts_list = get_posts( $args );
        if ( count( $posts_list ) ) {
          $html = '<table class="products-list">'.PHP_EOL;
          $html .= '<tbody>';
          foreach ( $posts_list as $post ) {
            setup_postdata( $post );
            $html .= '<tr>'.PHP_EOL;
            $my_title = get_the_title();
            $my_permalink = get_the_permalink();
     	    $html .= '<td><a href="'.$my_permalink.'">'.$my_title.'</a></td>'.PHP_EOL;
     	    $html .= '<td>'.$availability. '</td>'.PHP_EOL;
            $_product = wc_get_product( $post->ID );
            $price = $_product->get_price_html();
            $html .= '<td class="products-list-price">'.$price.'</td>'.PHP_EOL;
    	    $html .= '</tr>'.PHP_EOL;
            wp_reset_postdata();
          }
          $html .= '</tbody>';
          $html .= '</table>'.PHP_EOL;
        } else {
          $html = 'No products found'.PHP_EOL;
        }
        return $html;
      }
    
    • This reply was modified 8 years, 2 months ago by bolide.
    Thread Starter bolide

    (@bolide-1)

    CSS now in the child theme style.css. After a bit of editing:

    https://www.bn1studio.co.uk/category_test_2/

    Many thanks

    Thread Starter bolide

    (@bolide-1)

    HI

    Thanks – that’s a really good start. I was struggling with the structure of where to implement what but have put this in the child functions.php and it works nicely

    I am little confused as to why the CSS has to live in Dashboard > Appearance > Customise > Additional CSS. Can’t I put it in style.css in my child theme?

    I’ll test & find out

    Thread Starter bolide

    (@bolide-1)

    WP version: 4.7.1
    Woocommerce version: 2.6.11

    Lots of ways: use a redirect plugin to rewrite your base URL to the events calendar page, revise your .htaccess file or change the landing page in your hosting control panel to do the same thing

    This is really a hosting / wordpress question, not an Events Calendar thing

    Nick Froome

    Thread Starter bolide

    (@bolide-1)

    OK, I can print a date using

    <?php echo $day['date'] ?>

    in single-day.php, but I am struggling to format this into a day number. My PHP syntax knowledge is not good enough

    If the string can be formatted with ‘z’ that will print the day of the year

    Thread Starter bolide

    (@bolide-1)

    Ok, I am beginning to see how to get to this. I will take the daynum and use that to calculate a value which I’ll put into a snippet of online CSS in single-day.php to override the main css file

    I might split the seasons out into separate entries in a local tribe-events.css file so I can change the highlight colours there, but the date range calculations will have to be done on the fly in single-day.php

    It’d be nice to have the date ranges not in the single-day.php file but I think that’s a bit beyond my pay grade

    Nick Froome

    Thread Starter bolide

    (@bolide-1)

    Bumping this request up the list

    To add a little more detail, I’d like to have, in the month view, each day cell to have a coloured background

    The background colour would denote the season – low, high, special, etc

    Each season would have a start date & end date. The seasons would not overlap but might not start & end on week boundaries

    If required, they could be shifted to change on week boundaries

    I can see how this might be applied in a daily view but not sure how it might be achieved in a monthly view

    Nick Froome

    The easiest way I can think of is using CSS with a “test” to see the category name, for example:

    if category = football, colour = red

    It might be better done with a table of category names and colours

    football FF0000
    hockey 00FFFF

    if category = football, colour = FF0000

    and pull the colour code into the CSS for the text display

    Nick Froome

    Thread Starter bolide

    (@bolide-1)

    OK, I found the CSS hidden in a PHP file

    Does this plugin place nice with Jetpack?

    When clicking the Facebook like button the window spawned is about 20 pixels wide and most of it can’t be seen

    The only plugin I have installed that I think may be relevant to the problems is Jetpack

    I am using WordPress 3.6 d the latest versions of all plugins

    Thanks

    TEC Events are a custom post type as well… I think your options are to create a template for a TEC single event display that is the same as your existing template, and switch to using it, or a redirect

    If you want to redirect the URL try the Redirection plugin but be aware there are a couple of bugs with it and, depending how you use it, it may not play nice with TEC

    You should be able to define a simple rule to redirect from a TEC calendar listing to your custom post type

    Nick Froome

    You should be able to do this by changing the PHP date format in the HTML template. You can find the formatting tags by Googling for PHP Date() – just select the tags yu need and amend the template accordingly

    Nick Froome

Viewing 15 replies - 16 through 30 (of 119 total)