• Supporting LazyEater in themes.

Supporting LazyEater in themes.

LazyEater is a multi-vendor restaurant network plugin. To get this kind of plugin to work on WordPress, there should be a (Theme + Plugin) efforts. Thus, LazyEater was built to only work on themes that support it like Frozr WP Theme that natively supports LazyEater, you can get it for free from here. But due to many requests we got from customers to support other themes, we modified the code of LazyEater 1.1.4 to work on other themes, you only have to prepare the homepage and add some WooCommerce templates. Follow the steps below to get this done perfectly while we are assuming that you are familiar with WordPress and CSS.

In this article we will make the naive WordPress Twentyfifteen theme support LazyEater. Before we start make sure LazyEater and WooCommerce plugins are installed and activated, both plugins can be installed from the WordPress plugins repository, also make sure that Twentyfifteen is activated.

Creating the LazyEater homepage.

The lazyEater homepage includes the following sections:

  • The Food/Restaurants advance search section.
  • The latest restaurants section.
  • The top selling items.

We will use those sections shortcodes to add them to the Twentyfifteen home page.

  • [lazyeater_advance_search]
  • [lazyeater_best_selling_dishes]
  • [lazyeater_latest_restaurants]
  1. Start with creating a new WordPress page with “Home page” as title and past the above shortcodes in the page content and save the page.1
  2. Create a new page with “Blog” as title and leave other fields empty and save the page.2
  3. You should now use”Home page” page as your Front page and the “Blog” page as your posts page. Go to ‘Settings’ => ‘Reading’ and change the ‘Front page displays’ option to ‘A static page’ . Select “Home page” as your front page and “Blog” as your posts page and save settings.3

The home page now should look like this:

4

Note: You can add the LazyEater homepage sections to php by using the following codes:

  • do_action('frozr_home_advance_search');
  • do_action('frozr_top_selling_dishes');
  • do_action('frozr_latest_resturants');

As you can see that Twentyfifteen adds some styles to the default WordPress page, preventing a native LazyEater home page layout. In case your theme also add styles to pages, follow these steps:

  1. Edit the “Home Page” page.
  2. From the Page Attributes meta-box select the “Frozr White Template” and Save the page.5

The home page now should look like this.

6

Adding LazyEater Widgets

LazyEater 1.1.4 adds two widgets:

  1. User Location Widget.
  2. Admin/Seller Widget.

We will add those two widgets to the theme sidebar.

7

The theme sidebar now should look like this:

8

Note: You can add LazyEater widgets to php by using the following code:

  • do_action('frozr_location_popup');
  • do_action('frozr_lazyeater_admin_dashboard_menu', $show_title = false);

Adding WooCommerce Templates

The last step in this is to override the WooCommerce cart template with a custom one so will create a child theme for Twentyfifteen and add the template file:

  • twentyfifteen-child/woocommerce/cart/cart.php

You can get the cart template from here.

Add theme support

After all the above steps are done, you can now tell LazyEater that this theme supports you! by adding a one line of code to the theme’s child theme function.php file.

// Add support for Frozr LazyEater plugin
add_theme_support( 'frozr-lazyeater' );

Finally

All done, We have made the native Twentyfifteen theme now support LazyEater. You will note that LazyEater is working fine but maybe looks not fine, this is because LazyEater pages will come with minimum css styles, you should use some css styles to get LazyEater fully integrated with your theme. Note that any css styles should be added to the child theme so you can be safe of any future updates for the theme you are using.

Post Comment

You must be logged in to post a comment.