Zen Cart Logo
Forums / Addon Templates / Help with some PHP editing a new template (Picaflor)

Help with some PHP editing a new template (Picaflor)

Views: 7,260

Results 61 to 80 of 85
21 Apr 2013, 5:42 AM
#61
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Help with some PHP editing a new template (Picaflor)

Ok so I was able to add all of the links to the footer that I wanted, thank you!

There is an additional "Home" link, it was one of the original links & it was always on top of all of the other footers for some reason.

Any idea where that "Home" link is being generated so I can shut it off?

Also I figured it would be easier & cleaner to be able to put everything in the one footer including the Copyright C Visionaryscience.net 2013

But since I created it in EZ pages I suppose it created the link as an additional page, is there any way to break the link on that particular EZ Page footer file that I created for it so that it's just stationary text with no click ability?

I figure worse case scenario I could just link it back to the home page, but if I can make it just text that would be preferred.

Thanks again.

21 Apr 2013, 7:31 AM
#62
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help with some PHP editing a new template (Picaflor)

Add to your stylesheet```
#navSupp li {list-style: none; display: inline;}


The ez-page links cannot be made non-linking without custom PHP coding.
21 Apr 2013, 7:37 AM
#63
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Beautiful, thank you!

I'm almost finished, just a few more things to go.

What can I do about the Copyright© giving me font errors and changing to: Copyright©

Is there anyway to break that Copyright link so it's just text? I created it in EZ Pages & couldn't figure out any other way to get it on there.

21 Apr 2013, 7:52 AM
#64
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help with some PHP editing a new template (Picaflor)

I'm not certain how you can fix that. I think it is related to conflicting character sets in use by your site. It might be as simple as using the plaintext editor instead of the WYSIWYG editor for that ez-page (if that is what you are using) and putting in the correct HTML code for the copyright symbol; but there might be a database mismatch that will corrupt that, I don't know.

21 Apr 2013, 3:53 PM
#65
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

What are you entering for the copyright code???

try the html escape code (remove spaces) and enter it in plain text mode

& # 1 6 9 ;

22 Apr 2013, 12:08 AM
#66
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

kobra:

What are you entering for the copyright code???

try the html escape code (remove spaces) and enter it in plain text mode

& # 1 6 9 ;

That worked, thank you!

gjh42:

The ez-page links cannot be made non-linking without custom PHP coding.

Is there an easy way to add text to the footer besides EZ Pages?

22 Apr 2013, 1:43 AM
#67
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,763
Plugin Contributions:
9

Re: Help with some PHP editing a new template (Picaflor)

Apparently there IS a way to get 75 different questions answered in one thread.:P

22 Apr 2013, 2:39 AM
#68
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

dbltoe:

Apparently there IS a way to get 75 different questions answered in one thread.:PYes and most are already answered in the FAQ/Tutorials and by searching the forum.
Even "try it and see" what happens also works.

22 Apr 2013, 5:17 AM
#69
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Help with some PHP editing a new template (Picaflor)

gilby:

Yes and most are already answered in the FAQ/Tutorials and by searching the forum.
Even "try it and see" what happens also works.

I said the same thing in another thread, but was told that this advice (which as we all know is very good advice) is not "helpful".. shrugs

24 Apr 2013, 9:32 AM
#70
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

DivaVocals:

I said the same thing in another thread, but was told that this advice (which as we all know is very good advice) is not "helpful".. shrugs

I appreciate your help as well as everyone elses. Just being on a new platform & dealing with a lot of PHP, it can be over-whelming & frustrating sometimes & asking a quick question in a help forum with a lot of very helpful, knowledgeable & nice people is a godsend...

I've figured out how to turn things on/off in the Left side bar Categories, but I'm still having an issue moving the "All Products" link to the top of the list.

I've found the code in the tpl_categories.php, but when I try to make edits I'm tripping over the correct PHP coding by a symbol or two I think.

// display a separator between categories and links
    if (SHOW_CATEGORIES_SEPARATOR_LINK == '1') {
//      $content .= '<br />' . zen_draw_separator('pixel_silver.gif') . '<br />';
//      $content .= '<hr id="catBoxDivider" />' . "\n";
      $content .= '<br style="line-height: 0;" />' . '<hr id="catBoxDivider" />' . '<br style="line-height: 0;" />';
    }
    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
      $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
        $content .= CATEGORIES_BOX_HEADING_SPECIALS . '</a></div>';
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true') {
      // display limits
//      $display_limit = zen_get_products_new_timelimit();
      $display_limit = zen_get_new_date_range();

      $show_this = $db->Execute("select p.products_id
                                 from " . TABLE_PRODUCTS . " p
                                 where p.products_status = 1 " . $display_limit . " limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_NEW) . '">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
        $content .= CATEGORIES_BOX_HEADING_WHATS_NEW . '</a></div>';
      }
    }
    if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') {
      $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
        $content .= CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a></div>';
      }
    }
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
      $content .= CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a></div>';
    }
  }
24 Apr 2013, 6:41 PM
#71
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

You will want to cut this code from a copy for your template of tpl_categories.php

    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }  

And paste it here

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }  
  for ($i=0;$i<sizeof($box_categories_array);$i++) {
    switch(true) {

Now let this thread close and post any additional issues in their own thread

24 Apr 2013, 6:50 PM
#72
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

Just an addition

Code should be as follows - adding a "$content .= '<br />' . "\n";" highlighted in red

  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }
	$content .= '<br />' . "\n";
  for ($i=0;$i<sizeof($box_categories_array);$i++) {
24 Apr 2013, 7:11 PM
#73
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Help with some PHP editing a new template (Picaflor)

JohnnyScience:

I appreciate your help as well as everyone elses. Just being on a new platform & dealing with a lot of PHP, it can be over-whelming & frustrating sometimes & asking a quick question in a help forum with a lot of very helpful, knowledgeable & nice people is a godsend
Except 8 pages later that's CLEARLY not what you did (ask a **quick **question). Which is why we are pointing this out.. What you DID do was to create an 8 page personal thread where you've asked a TON of questions, MANY (not all) of which are covered in the readme for the template you are using, or have already been posted in this forum (and can be found by searching the forum), or are covered by FAQs. Hence why HINTS about using these sources were posted by myself and others (including the author of the template you are using..).

Don't get me wrong..This is a volunteer run forum, and no one minds helping... but when it seems that the person is simply asking questions without looking for of the readily available information on these topics, well.. it makes one take pause.. You can take that for what it's worth, but you should note that others here have strongly hinted at what I am saying to you directly..
:smile:> kobra:

Now let this thread close and post any additional issues in their own threadAMEN!!!! :clap:

1 May 2013, 2:47 AM
#74
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

kobra:

Just an addition

Code should be as follows - adding a "$content .= '<br />' . "\n";" highlighted in red

$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
$content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
}
$content .= '<br />' . "\n";
for ($i=0;$i<sizeof($box_categories_array);$i++) {


Ok so that worked, thanks!

How do I get a bullet next to the new "All Products" like the other links have and put the separating line between the two?

And the hover is different compared to the other links, any idea what/where to add to make it have the same hover effect?

This might be one of the last things I had to do to finish the site.  Now I need to move on to installing a payment module & getting approved through a gateway.  (Already in talks with Chase Paymentech)

I want to send out a BIG THANKS to everyone that helped me in this thread, I really truly appreciate it. (even though I might have irritated a couple along the way :blush::smile:
4 May 2013, 5:05 AM
#75
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

Any idea on the last couple of styles I need for the sidebar?

Thanks.

8 May 2013, 3:25 AM
#76
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

bump... :lookaroun

8 May 2013, 3:44 AM
#77
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Help with some PHP editing a new template (Picaflor)

bump
Forum do's & dont's
http://www.zen-cart.com/faq.php?faq=vb_faq#faq_do_and_don'ts
Dont Bump your post. If you have not gotten an answer in a reasonable amount of time. Post a reply to your own existing post with more details of what you have and haven't done to attempt to cure the problem or find answers to your questions. Try to explain it in a different way if maybe it's unclear.

Now let this thread close and post any additional issues in their own thread

8 May 2013, 12:48 PM
#78
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Help with some PHP editing a new template (Picaflor)

JohnnyScience:

Any idea on the last couple of styles I need for the sidebar?

Thanks.

JohnnyScience:

bump... :lookaroun

In addition to what kobra has said, sometimes when a post goes unanswered it simply means:

  • People are busy and haven't had time in their schedule to come up with a solution..
  • No one knew the answer
  • No one wants to answer

simple as that.. with regards to the last bullet point.. perhaps no one wants to answer because the answer is not a SIMPLE solution..

6 Jun 2013, 7:52 AM
#79
johnnyscience avatar

johnnyscience

Zen Follower

Join Date:
Jan 2013
Posts:
104
Plugin Contributions:
0

Re: Help with some PHP editing a new template (Picaflor)

kobra:

You will want to cut this code from a copy for your template of tpl_categories.php

if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
  $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
}  
> And paste it here
> ```
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }  
  for ($i=0;$i<sizeof($box_categories_array);$i++) {
    switch(true) {

Now let this thread close and post any additional issues in their own thread

I'm trying to move the "Featured Products" up under the All Products & when I copy & paste the following code, it breaks the page for some reason:

 $content = "";
  
   $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
    }
	if (SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true') {
      $show_this = $db->Execute("select products_id from " . TABLE_FEATURED . " where status= 1 limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<div class="betterCategories"><a class="category-links" href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS) . '">';
        $content .= zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_boxes.gif') . $spacer;
        $content .= CATEGORIES_BOX_HEADING_FEATURED_PRODUCTS . '</a></div>';
      }
	$content .= '' . "\n";
  for ($i=0;$i<sizeof($box_categories_array);$i++) {
    switch(true) {

Any idea what I'm doing wrong?

Thanks.

6 Jun 2013, 2:13 PM
#80
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Help with some PHP editing a new template (Picaflor)

You have the BetterCategories version of tpl_categories.php, not the stock version as kobra was working from in his advice, so the organization may be different. We would need to see the whole links section of the file (before your modifications) to be sure of a safe way of moving links.