ResolvedBranch/Store visualization and change
Tagged: branch
- This topic has 5 replies, 2 voices, and was last updated 1 day, 6 hours ago by
swellboyvn.
- AuthorPosts
- March 14, 2023 at 9:58 pm #37145
swellboyvn
ParticipantHow to place a button in the header/ menu with the selected branch. On click to show the popup again for branch changing?
March 20, 2023 at 10:20 am #37149swellboyvn
ParticipantHow to temporarily close one of the stores/branches if need it?
March 20, 2023 at 1:34 pm #37152swellboyvn
ParticipantI found it. How to set different order numbers for different locations/branches in the header?
March 28, 2023 at 3:16 pm #37175Alex
KeymasterHello swellboyvn,
Sorry for the delay.
You can use one, all, or some of the predefined places where to put the currently selected branch info box (with a button to change the branch). Go to WooCommerce-> Lafka Shipping Settings -> Branch Locations -> Show Branches Info Box in
It is possible also to add it to more specific places but it will require some custom coding. You can look at the following topic for more details: Need pickup and delivery selector in header
I am not sure I understand your other question about the order numbers. Could you please be more specific.
Regards,
AlexMarch 30, 2023 at 11:21 am #37192swellboyvn
ParticipantIn your functions.php of the child theme add this code:
function branches_shortcode() { ob_start(); // start output buffering // call the Lafka_Branch_Locations::show_change_branch() function add_action('get_footer', array('Lafka_Branch_Locations', 'show_change_branch'), 1); Lafka_Branch_Locations::show_change_branch(); $output = ob_get_clean(); // get the buffered output return $output; } add_shortcode('branches', 'branches_shortcode');
After that, you can display the branches picker anywhere with this block [branches].
Thank you Alex.
March 30, 2023 at 12:26 pm #37194swellboyvn
ParticipantSmall fix 🙂
function branches_shortcode($atts) { $atts = shortcode_atts(array( 'id' => '', ), $atts, 'branches'); static $content = array(); // declare a static variable to store the content if (!isset($content[$atts['id']])) { ob_start(); // start output buffering Lafka_Branch_Locations::show_change_branch(); $content[$atts['id']] = ob_get_clean(); // get the buffered output } return $content[$atts['id']]; } add_shortcode('branches', 'branches_shortcode');
- AuthorPosts
You must be logged in and have valid license to reply to this topic.