Jump to content

if $loggedin cart.php & new /store/productgroup/


Recommended Posts

Hello,

So fiddling about on the dev install with the new V8.

Came accross an issue (well for us it is) when we use {if $loggedin} and the {if $filename == 'cart'} to display specific content only on the cart pages in regards to the new friendly URLs.

Prior to V8 we could easily add in {if $loggedin}and the {if $filename == 'cart'} statements to display it how we wanted. However the new product category URL redirects to the friendly URL and as such our content now gets displayed which we dont want.

Works fine for the other URLs as the cart.php is still shown. This:

{if $loggedin}

{include file="$template/includes/example.tpl"}
							
{else}
  
{if $filename == 'cart'}

{include file="$template/includes/CARTexample.tpl"}

{/if} 

used to (prior V8) display OR strip out content/templates for the cart views.

It however doesnt work on the new friednly URL for inital product category BUT does work when going 1 step further. I assume its due to the firndly URL for the product category BUT cannot fugure out what to add so it works on the product category page too.

Have tried to include: || $filename == 'store' but thats not working either.

Any insights on how this can be fixed???

FYI looks like this is going to be a problem IF/when products themselves get a friendly URL (which would be about time and welcomed)...

Link to comment
Share on other sites

23 minutes ago, Manchester Web Hosting said:

Have tried to include: || $filename == 'store' but thats not working either.

it would be 'index' I think regardless of FU setting - but then again, lots of pages filenames will come under 'index' by the looks of it.

23 minutes ago, Manchester Web Hosting said:

Any insights on how this can be fixed???

I would have thought by using...

{if $inShoppingCart}

to detect whether you are in one of the cart pages - it should only exist/be set to true on cart pages.

23 minutes ago, Manchester Web Hosting said:

FYI looks like this is going to be a problem IF/when products themselves get a friendly URL (which would be about time and welcomed)...

not if the above continues to work... although even if it doesn't, there would be other ways, e.g checking the template name, checking if $carttpl exists or many other more involved methods that my devious mind could devise. 😎

Edited by brian!
Link to comment
Share on other sites

3 minutes ago, brian! said:

I would have thought by using...


{if $inShoppingCart}

@brian! Fantastic! That works great. Should have guessed it was something simple as that but couldnt for the life of me find out what it was 😞

Now replaced all calls that used: {if $filename == 'cart'} TO {if $inShoppingCart} which seems to have done the trick.

6 minutes ago, brian! said:

not if the above continues to work...

Hope so thats the simple way (like simple) agree therewould be other ways. Hoping that the long awaited friednly URLs hot the product pages too. Maybe they will eventually get to adding in the ability to update titles and metas at some pint in 2050 too 😉 Heres hoping!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated