alexandre
alexandre

Reputation: 335

use WooCommerce classes in own php

How to create a woocommerce page, where headers can be set manually and no design/theme will be called?

My approach was to just create a php file in the wp-content/uploads folder, but how to access classes like WC_Order in there? Other approach would be to just create a new page in wordpress and use a shortcode, but then my theme will be loaded, which I don't want.

Upvotes: 0

Views: 1202

Answers (2)

Ashish Patel
Ashish Patel

Reputation: 3614

After activate woo commerce plugin use global variable

global $woocommerce;

by which you can access woo commerce for those pages where headers can be set manually and no design/theme will be called.

Check out below link for add custom pages: Create a Custom Page

Upvotes: 1

mattkrupnik
mattkrupnik

Reputation: 527

If you want create blank template page without theme styles replace get_header(); with

 <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-title"
          content="<?php bloginfo( 'name' ); ?> - <?php bloginfo( 'description' ); ?>">
    <link rel="profile" href="http://gmpg.org/xfn/11">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
    <?php wp_head(); ?> <!-- Important! - Must be -->
</head>

Upvotes: 0

Related Questions