Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Maeve Lander

    (@enigmaweb)

    WP Catalogue is not an eCommerce plugin. You can manually add a buy button to each product post if you want, but for a serious eCommerce site I would recommend you use a plugin that is built to do that job. Personally, my eCommerce plugin of choice is Shopp

    Thread Starter lozadaOmr

    (@lozadaomr)

    No, I am not trying to make an e-commerce site, I only wanted to display the product price on grid view.

    I managed to display it if it is alright, I can post the solution so if others want it if it is okay. (I just played the plugin and managed to make it work.)

    Hey lozadaOmr,
    could you please share your solution?

    Thanks in advance

    Thread Starter lozadaOmr

    (@lozadaomr)

    I would suggest you backup your plugin first, test it on a localhost server.

    1. Go and edit wpc-catalogue.php
    2. Add the following code

    //Added this part after the $post_data = get_post($post->ID, ARRAY_A);
    // Which basically came from single-wpcproduct.php
    $terms1 = get_the_terms($post->id, 'wpccategories');
    if($terms1) {
    
    foreach( $terms1 as $term1 ) {
     $slug = $term1->slug;
     $tname = $term1->name;
     $cat_url = get_bloginfo('siteurl').'/?wpccategories=/'.$slug;
     };
    }

    Then look for this part of the code

    while($products->have_posts()): $products->the_post();

    and insert this code

    //this the code for fetching the price
    		$product_price = get_post_meta(get_the_id(), 'product_price', true);

    After this part

    $price = get_post_meta(get_the_id(),'product_price',true);

    Then look for this line of code, and insert $product_price like this one

    $return_string .= '<p class="wpc-title"><a href="'. $permalink .'">'.$title.'₱'.$product_price.'</a></p>';

    Sorry, for the complicated instructions I was just messing with the plugin files, and eventually made it work.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add product price on Product Grid’ is closed to new replies.