Forum Replies Created
- AuthorPosts
- kadsyyParticipant
Hi,
Letting u know that i successfully created the custom shortcode. thank you so much for pointing out the ‘class-wcfmmp-shortcode.php(function name : wcfmmp_stores_shortcode)’ file. It’s really helped a lot. I cant thank you enough i wish i can give u a hug. Thanks again and u have a great day ahead!
kadsyyParticipantBecause i want to make several customizations on the listing. i know i can copy the template file from’views/store-list/’ folder and put in my theme but it will affect to all “[wcfm_stores]” shortcode right?
i believe i can add another css style and define it in the template file but what if i want to change the layout which involve changing some divs etc?
is there a way i can make another theme/template for “[wcfm_stores]” shortcode? this is basically my purpose for the shortcode i written.
Thanks.
kadsyyParticipantHi, thanks for your reply. I have adjust my code, this is what i get so far
<?php function vendor_list_function() { global $WCFM, $WCFMmp, $post; $store_user = wcfmmp_get_store($store_id); $store_info = $store_user->get_shop_info(); $store_name = isset($store_info['store_name']) ? esc_html($store_info['store_name']) : __('N/A', 'wc-multivendor-marketplace'); $store_name = apply_filters('wcfmmp_store_title', $store_name, $store_id); $store_url = wcfmmp_get_store_url($store_id); $store_description = $store_user->get_shop_description(); $wcfm_shop_description = apply_filters('wcfmmp_store_about', apply_filters('woocommerce_short_description', $store_user->get_shop_description()), $store_user->get_shop_description()); ?> <div class="wcfmmp-stores-content-holder"> <div class="wcfmmp-stores-content"> list vendor with info <ul class="wcfmmp-store-wrap"> <?php foreach ($store_user as $store_id) { $args['store_id'] = $store_id; echo '<li> name: '. $store_name . '</li>'; echo '<li> address: '. $store_address . '</li>'; echo '<li> url: '. $store_url. '</li>'; echo '<li> description: '. $wcfm_shop_description . '</li>'; echo '================='; } ?> <div class="wcfm-clearfix"></div> </ul> </div> </div> <?php } add_shortcode('vendor_list_test', 'vendor_list_function');
unfortunately the loop give incorrect and empty data. i know this code got a lot of problems since im totally newbie in php. i hope u dont mind walk me thru this. thanks again.
- AuthorPosts