You are here:  » Shortcodes


Shortcodes

Submitted by Perce2 on Wed, 2022-03-02 12:33 in

Hi David,

using shortcodes like this [pto search="keywords" limit="1"]
Is it possible to show the results without product filters and the page navigation bar?

I would just like to insert products inside post content.

Graham

Submitted by support on Wed, 2022-03-02 13:38

Hi Graham,

No navigation is actually the default I think you have added that as a modification so if you check pto.php look for this code around line 839:

          $html .= pto_search_navigation();

...and comment out or delete to remove the navigation from shortcode search results.

To remove the filters, in the same file look for the following code at line 837:

          $html .= pto_search();

...and REPLACE with:

          global $pto_noFilters;
          $pto_noFilters = TRUE;
          $html .= pto_search();

And then in pto_search.php look for the following code around line 570:

  if ((!$pto_product) && (!isset($pto_searchResults[0]->api))) $html .= pto_search_filters_html();

...and REPLACE with:

  global $pto_noFilters;
  if ((!$pto_product) && (!isset($pto_searchResults[0]->api)) && (!isset($pto_noFilters))) $html .= pto_search_filters_html();

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Wed, 2022-03-02 14:32

Hi David,

have PM'd you with a copy of my pto_search.php, think it's a little more modded than just the extra navigation.

Appreciate your help with this.

Thanks,
Graham

Submitted by Perce2 on Fri, 2022-03-04 05:35

Hi David,

As I feared, making those adjustments prevents the previous mods from working.
I've rolled them back.

I've now tried a simpler approach by using css which gives the desired effect, but now I have another issue that the inserted single product on page effects the rest of the page layout. Causing the sidebar widgets to drop below the main content on page. Have tried changing css but to no avail.

Any pointers as to what could be causing this? Javascript?

Submitted by support on Fri, 2022-03-04 08:30

Hi Graham,

That sounds like an HTML imbalance e.g. a <div> not being closed affecting the page layout.

If you view the page in Firefox then right-click on the page and go to View Page Source... where any markup errors will be highlighted in red. Find the section of the html where the product info is displayed and see if in particular any markup errors are highlighted there which you can then cross reference with the product template in wp-admin > Settings > PriceTapestry.org...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Fri, 2022-03-04 10:11

Hi David,

the plot thickens...

Have gone through the html (again), also checked with browser developer tools etc. and can't find any obvious problems. All elements closed as expected.

Can you confirm that PTO does actually run properly on a page with a sidebar?
Not easy to check now as you've removed the demo site.
All my installs are running on full-page widths, no sidebar.

Have tried on a couple of sites, new clean page with sidebar, shortcode [pto search="keywords"], all showing same problem!
Switched theme to WP latest 2022, gives same problem.

Any suggestions?

Submitted by Perce2 on Sat, 2022-03-05 05:53

Hi David,

Yes, you were right!

Eventually found the culprit, an extra closing in the HTML template "Search Filters Widget"

Many thanks,
Graham