Community @ The Turning Gate

Support community for TTG plugins and products.

NOTICE

The Turning Gate's Community has moved to a new home, at https://discourse.theturninggate.net.

This forum is now closed, and exists here as a read-only archive.

  • New user registrations are disabled.
  • Users cannot create new topics.
  • Users cannot reply to existing topics.

You are not logged in.

#1 2017-09-26 13:14:03

markh
Member
From: Center of The US
Registered: 2012-09-24
Posts: 380
Website

Trying to add some text to the cart form using phplugins...

I have a page template solely for the cart (too bad I can't seem to use an album template). So it seems i'm constrained to using phplugins to add things to the page. I've been trying to stick some text in the page with the ttg_copy_top function but that doesn't seem to be working. Hook looks like this:

function ttg_copy_top( $style, $path ) {
    echo 'Here is some text.';
return true;
} // END

Other hooks on the page are working.
No doubt something simple or stupid that I've done. A club on the head would be most helpful if anyone's got one.
Regards Mark
Whoops. Site is at https://photophart.com

Offline

#2 2017-09-26 16:49:44

Matthew
Administrator
From: San Francisco, CA
Registered: 2012-09-24
Posts: 5,795
Website

Re: Trying to add some text to the cart form using phplugins...

You can assign an album template via the menu, Designer => Templates => Assign Templates.


Matt

The Turning Gate, http://theturninggate.net

Offline

#3 2017-09-26 18:38:05

markh
Member
From: Center of The US
Registered: 2012-09-24
Posts: 380
Website

Re: Trying to add some text to the cart form using phplugins...

Tried that. The only choices in the drop down box for cart templates are page templates, no album templates.
Thanks, Mark

Offline

#4 2017-09-26 22:36:50

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Trying to add some text to the cart form using phplugins...

My guess is that since the Cart page uses forms inside the copy area, that the ttg_copy_top and ttg_copy_bottom hooks are not active. This would keep the cart contents from accidentally being removed. Just a guess though.

What are you looking to add? If it's just text, you can use the Localizations page in Cart Settings.
Under the Shopping Cart section in the HEADING_CART field, you can change the text.
But since the HEADING_CART field puts the text in an H1 heading tag, the text will be sized at H1 size. To get around this, put your text inside a p tag. You'll need to style it though:

Your Cart <p style="font-size:1rem;">More text on page</p>

It looks like you can put any html in there. This works too:

Your Cart <div style="font-size:1em;"><p>More text on page</p></div>

Putting other html inside a heading tag may not be semantically correct, but it works.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

#5 2017-09-26 23:15:18

markh
Member
From: Center of The US
Registered: 2012-09-24
Posts: 380
Website

Re: Trying to add some text to the cart form using phplugins...

Rod, That is an inspired idea! Probably easiest to use the inline styling too...yes?
Many Thanks
Mark

Offline

#6 2017-09-26 23:31:44

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 17,830
Website

Re: Trying to add some text to the cart form using phplugins...

if you only need to to his once, then the inline styling is probably easiest.


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Backlight 2/3 test site

Offline

Board footer

Powered by FluxBB