Woocommerce Single Product Page and Shop page

Posted in: Newspaper
Post count: 9

Hello,

We are using Newspaper Version: 9.0.1 We have a major problem with woocommerce. After creating 2 products and publish them on the website, these products are not visible and on the single product page, the footer also not visible just on the product page ?

here is a link for the product page http://acweek.staging.wpengine.com/product/table-10/

We refreshed permalinks and tried the best to solve the issue, still couldn’t fix it.

I look forward to hearing from you.

Thanks

David

Post count: 20688

Hi,

Seems that the shop page and the product page are empty from the header down. You could check if there are enough resources as a first step
https://forum.tagdiv.com/requirements-for-newspaper/
Be sure to check if this is available – https://www.screencast.com/t/So5ne5Qu

https://docs.woocommerce.com/document/server-requirements/

There is also an error which seems to appear only in Woocommerce pages
https://www.screencast.com/t/HI92BHsDhgK
You could also contact the hosting provider if possible and mention this to them, they might have some ideas.

Thanks

Post count: 9

Hello,

We contact our hosting and they reported the below;

PHP Fatal error: Call to undefined method td_page_generator::wrap_start() in /nas/content/live/acweek/wp-content/themes/Newspaper/woocommerce.php on line 61, referer: https://www.aircargoweek.com/basket/

Could you please help us. Thanks

Post count: 20688

The path seems to refer to a woocommerce.php file in the main theme folder. But there is no such file in the theme. Could you please check that and let me know?

Post count: 9

Yes this file exist in main theme folder. Also there is a folder with the same name.

Code below in the file ; please copy the code and check line 61

<?php
/* —————————————————————————-
the page template
*/

td_global::$current_template = ‘woocommerce’;

get_header();

// test fork radu test 1
//set the template id, used to get the template specific settings
$template_id = ‘woo’;

$loop_sidebar_position = td_util::get_option(‘tds_’ . $template_id . ‘_sidebar_pos’); //sidebar right is default (empty)

//read the custom single post settings – this setting overids all of them
$td_page = get_post_meta($post->ID, ‘td_page’, true);
if (!empty($td_page[‘td_sidebar_position’])) {
$loop_sidebar_position = $td_page[‘td_sidebar_position’];
}

switch ($loop_sidebar_position) {
case ‘sidebar_left’:
echo td_page_generator::wrap_start();
?>
<div class=”span4 column_container” role=”complementary” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/WPSideBar”>
<?php get_sidebar(); ?>
</div>
<div class=”span8 column_container td-no-pagination” role=”main” itemscope=”itemscope” itemprop=”mainContentOfPage” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/CreativeWork”>

<?php
woocommerce_breadcrumb();
woocommerce_content();
?>

</div>
<?php
echo td_page_generator::wrap_end();
break;

case ‘no_sidebar’:
echo td_page_generator::wrap_start();
?>
<div class=”span12 column_container td-no-pagination” role=”main” itemscope=”itemscope” itemprop=”mainContentOfPage” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/CreativeWork”>

<?php
woocommerce_breadcrumb();
woocommerce_content();
?>

</div>
<?php
echo td_page_generator::wrap_end();
break;

default:
echo td_page_generator::wrap_start();
?>
<div class=”span8 column_container td-no-pagination” role=”main” itemscope=”itemscope” itemprop=”mainContentOfPage” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/CreativeWork”>
<?php
woocommerce_breadcrumb();
woocommerce_content();
?>

</div>
<div class=”span4 column_container” role=”complementary” itemscope=”itemscope” itemtype=”<?php echo td_global::$http_or_https?>://schema.org/WPSideBar”>
<?php get_sidebar(); ?>
</div>
<?php
echo td_page_generator::wrap_end();
break;
}

get_footer();
?>

Post count: 22421

Hi,

That file is no longer part of the theme. It is an old file that remained in your install from older versions of the theme. If you simply overwrite the theme files and do not delete the old theme folder when updating you will be left with all of the unused theme files. Usually these should not influence the proper functionality of the theme as if a certain file is “decommissioned” it will no longer be called in the theme code. However this is not the case with the woocommerce file. You can simply remove woocommerce.php from your main theme folder as now the templates are grabbed from the woocommerce folder from the 2 template files: https://www.screencast.com/t/EMJmWcpBl

Thank you!

Post count: 9

Hi and thanks for your help.

I deleted the woocommerce.php file from theme directory … now i get this error when i want to click on the single product.

error :

502 Bad Gateway

Post count: 9

I also checked the woocommerce folder / templates /and i can see the single-product.php and archive-product.php

But we get 502 Bad Gateway

Post count: 20688

The shop page seems to work now, single product pages indeed do provide a 502 error
https://www.screencast.com/t/82oDWwYRr5PC

Maybe your server administrator can take a look at this, 502 errors appear mainly when there are hosting and server problems.

Post count: 9

Hi Simion,

Thanks, we were able to solve the issue.

One last question. We’ve updated the newspaper theme Version: 9.0.1 and we installed a child theme Newspaper 7 Child themeVersion: 7.7c

The child theme is active. The style.css sheet is not loading… tried to add some css but it doesn’t load! Also the code below is from the functions.php located in the child theme;

*/
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’, 1001);
function theme_enqueue_styles() {
wp_enqueue_style(‘td-theme’, get_template_directory_uri() . ‘/style.css’, ”, TD_THEME_VERSION, ‘all’ );
wp_enqueue_style(‘td-theme-child’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘td-theme’), TD_THEME_VERSION . ‘c’, ‘all’ );

}

How can we make the child theme style sheet load properly ??

Thanks

Post count: 20688

Glad you solved it. I tested the child theme as well, by adding some CSS in the stylesheet. Once activated the stylesheet is loaded checking in the page source
https://www.screencast.com/t/arimOiWA8l
Also the CSS I used is working – https://www.screencast.com/t/FxAG3Rj5
So it should work for you as well, check in the page source to see if the child theme is loaded.
Also be sure to use valid CSS in the stylesheet. Test if it works in the main theme
https://www.screencast.com/t/2Ox1JPWGZ9x

Post count: 9

Thanks for your advice.

Tried several times but it doesn’t work from the style.css

So, I instead put all my css in theme panel / custom code /custom css

Seems to be working okay now.

Thanks again!

Post count: 9

Hi again,

Now, I was thinking we fixed the original problem. But we have another error … once i add a product to the basket and click on view basket is empty!

And if you login as admin and repeat the process, the product is visible on the basket!

That’s mean only logged in users can see what in the basket, and not anyone else. Please visit this link here https://www.aircargoweek.com/table-reservations/

Try and add a product into the basket and click view basket …

I look forward to hearing from you.

Thanks

Post count: 20688

Hi,

Seems to happen just as you say, I tried it on your website. I found some similar topics you could follow and maybe try what is suggested
https://wordpress.org/support/topic/add-to-cart-not-working-unless-logged-in/
https://stackoverflow.com/questions/31533606/woocommerce-cart-empty-for-non-logged-in-users
https://businessbloomer.com/woocommerce-solving-cart-empty-issue/

Thanks

Viewing 14 posts - 1 through 14 (of 14 total)
The forum ‘Newspaper’ is closed to new topics and replies.