Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Tutorial: Creating a Custom Shop page
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Tutorial: Creating a Custom Shop page
- This topic has 1 reply, 2 voices, and was last updated 10 years by
Mohammad – SUPPORT.
-
Posted in: Neighborhood
-
August 8, 2014 at 10:58 pm #99554
This is a quick tutorial if you need to create your own “Shop” page and not use the default one. I did this as I am not fond of the word ‘Shop’ and wanted to use “Order Prints” instead. Feel free to replace “Order Prints” with your words of choice.
There are some complications to this as it involves a few changes to EMPTY CART calls by woocommerce and the theme. I did a search for all instances of “$shop_page_url” and made changes. If tech support can tell me if it is possible to hard code “$shop_page_url” as a globally defined URL then we can bypass all the below changes ๐
MAKE BACKUPS BEFORE PROCEEDING.
You will not be able to assign your new “Order Prints” page to the woocommerce shop settings as woocommerce will not follow the page builder elements you have created in your new shop page. So leave this option blank. If “Shop” is selected then hit the “x” button to clear it.
woocommerce / settings / Products / Product Archive / Shop Page (select page)
[see attachment neighborhood-custom-order-page01.jpg]
This involves using the neighborhood-child theme
1. Upload the default “neighborhood-child” theme to /wp-content/themes directory
Now we need to change all empty cart calls and link backs to the new shop page.
2. Copy /wp-content/themes/neighborhood/woocommerce/cart/cart-empty.php from the main neighborhood theme to your child theme keeping the directory structure in the child theme:
(/wp-content/themes/neighborhood-child/woocommerce/cart/cart-empty.php)Change line 25
<a class="continue-shopping" href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>"><?php _e( 'Go to the shop', 'swiftframework' ) ?></a>
TO
<a class="continue-shopping" href="http://www.xxxxxxxx.com/order-prints/"><?php _e( 'View Prints', 'swiftframework' ) ?></a>
Change line 27
<a class="continue-shopping" href="<?php echo get_permalink(woocommerce_get_page_id('shop')); ?>"><?php _e( 'View Prints', 'swiftframework' ) ?></a>
TO
<a class="continue-shopping" href="http://www.xxxxxxxx.com/order-prints/"><?php _e( 'View Prints', 'swiftframework' ) ?></a>
3. Copy /wp-content/themes/neighborhood/includes/swift-framework/sf-woocommerce.php to your child theme, keeping the directory structure /wp-content/themes/neighborhood-child/includes/swift-framework/sf-woocommerce.php
Change line 188
<a class="sf-roll-button shop-button" href="<?php echo esc_url( $shop_page_url ); ?>"><span><?php _e('Go to the shop', 'swiftframework'); ?></span><span><?php _e('Go to the shop', 'swiftframework'); ?></span></a>
TO
<a class="sf-roll-button shop-button" href="http://www.xxxxxxxx.com/order-prints/"><span><?php _e('View Prints', 'swiftframework'); ?></span><span><?php _e('View Prints', 'swiftframework'); ?></span></a>
4. Copy /wp-content/themes/neighborhood/includes/swift-framework/sf-content-display/sf-header.php to your child theme, keeping the directory structure /wp-content/themes/neighborhood-child/includes/swift-framework/sf-content-display/sf-header.php
Change line 809
$cart_output .= '<a class="sf-roll-button shop-button" href="'.esc_url( $shop_page_url ).'"><span>'.__('Go to the shop', 'swiftframework').'</span><span>'.__('Go To the shop', 'swiftframework').'</span></a>';
TO
$cart_output .= '<a class="sf-roll-button shop-button" href="http://www.xxxxxxx.com/order-prints/"><span>'.__('View Prints', 'swiftframework').'</span><span>'.__('View Prints', 'swiftframework').'</span></a>';
5.copy /wp-content/themes/neighborhood/woocommerce/loop/result-count.php to your child theme, keeping the directory structure /wp-content/themes/neighborhood-child/woocommerce/loop/result-count.php
Change line 16:
$shop_page_url = ""; if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) { $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); } else { $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); }
TO
$shop_page_url = "http://www.xxxxxxxxx.com/order-prints/"; <!-- if ( version_compare( WOOCOMMERCE_VERSION, "2.1.0" ) >= 0 ) { $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) ); } else { $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) ); } -->
6. Copy /wp-content/themes/neighborhood/woocommerce/cart/cart.php to your child theme, keeping the directory structure /wp-content/themes/neighborhood-child/woocommerce/cart/cart.php
Change line 161
<a class="continue-shopping" href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>"><?php _e('Continue shopping', 'swiftframework'); ?></a>
TO
<a class="continue-shopping" href="http://www.xxxxxxxx.com/order-prints/"><?php _e('Continue print shopping', 'swiftframework'); ?></a>
7. Now activate Neighborhood-Child as your theme (Appearance / Themes)
You should be done. After completion I did have to clear all cache, close & reopen my browser to see the results, page refresh didn’t work.
Again, if there is a simple way to globally define “$shop_page_url” in functions.php or something that would be great.
Thanks & Good luck!
Attachments:
You must be logged in to view attached files.August 11, 2014 at 11:27 am #99875Hi,
Thank you very much to share this solution.
Thanks ๐
With Best Regards
Mohammad -
Posted in: Neighborhood
You must be logged in to reply to this topic.