Jump to content

Enabled categories are hidden in category block..?


Recommended Posts

i want to make a category but dont want it to show in the categories module, how would i do this? even if i have to change the php.. id need to know where to put in... if category = said_category then dont dislpay(in the category block)

to access this category i would used a flyer/baner on the site.. btw

Link to comment
Share on other sites

Modify modules/blockcategories/category-tree-branch.tpl and add {if $node.id != 1} to the start of the file and {/if} to the end of the file, where 1 is the id of the category you want this hide. This will hide that category and its subcategories, while making them still accessible by URL.

You'll need to modify category-tree-branch.tpl in your theme's directory too so that the categories are hidden from the sitemap.

  • Like 2
Link to comment
Share on other sites

Change line 26 of contact-form.php from:

if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => $_POST['from'], '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from)))



to:

if (Mail::Send(intval($cookie->id_lang), 'contact', 'Message from contact form', array('{email}' => Configuration::get('PS_SHOP_EMAIL'), '{message}' => stripslashes($message)), $contact->email, $contact->name, $from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from)))

Link to comment
Share on other sites

i have those set but when contact-form is filled out you enter who you want to send to , customer service or webmaster.. you enter your email and enter messege..

then prestashop sends notification email to designated employee.. but when email is sent it is 'from' the email cutomer enters instead of the shop email address. which i think is wrong cause then i could send emails 'from' other peoples emails.

Link to comment
Share on other sites

I can't see a problem. It makes the email from the customer email so that you can just click "reply" and it will go to the customer. It won't send the email as being from the customer. If it were sent "From" the shop and your designated employee clicks "Reply", the email will be sent back to the shop itself instead of to the customer. That is why Prestashop changed it to the way it is now, so the employee didn't have to copy the email address from the content of the email and can simply click "Reply".

Link to comment
Share on other sites

but im gana want that email address transcribed anyways to other app im using .

i understand what your saing but i dont get "It won’t send the email as being from the customer."

and the email has a link of the customers email anyways so insted of clicking reply they can click on the mailto: link... assuming that it will open in the email client they want.. not like using web and opening in outlook.. though.. my yahoo opens mailto: in new yahoo email...

any who.. could you tell me how to change it anyways.. id appreciate it very much

in my yahoo mail in my inbox emails are From: My Shops Name
in email it is like this
From: "My Shops Name"

id like to know where to edit each of those. thanks much.

Link to comment
Share on other sites

Now that I re-read it, what I wrote is confusing. I meant you don't have to worry about accidentally writing emails as if they are from your customers. Which emails do you want to change the "From" field for? A couple of posts above, I already pointed out which code to change for the emails that come through the contact form. As far as I know, all the other emails already come from the shop email. You can do a global search for Mail::send on Prestashop to find every line of code that sends emails. You could also override the parameters in the send function in classes/Mail.php by writing $from = "[email protected]" and $fromName = "Shop Name".

Link to comment
Share on other sites

here is pic of notification sent to my email when contact form is filled out.

[email protected] was email address entered in the form.. i made changes to line 26 of contact-form.php and it change the from address in the messege of the email.. not the from address of the email..

and im not worried about accidentaly send messeges from customers email.. i just think its wierd that i could send emails to 'your' friends and family 'from' your email address.

15880_kgtP8z08qB5pErFFRPls_t

Link to comment
Share on other sites

I just checked and you are right. I was looking at the wrong variables. It is the following part of line 26 of contact-form.php you should change:

$from, (intval($cookie->id_customer) ? $customer->firstname.' '.$customer->lastname : $from)



to:

Configuration::get('PS_SHOP_EMAIL'), Configuration::get('PS_SHOP_NAME')

Link to comment
Share on other sites

so goht ta say, lovin the help so far. helping me get things working ideally. so got another one: in the accout page if there are vouchers for the customer logged in the voucher symbol is up, how can i get same thing on all pages, ie the header.. i coppied some code to try and it showed up in header but only when in one of the customer account pages.
i had something else but forgot, but ill remeember. hopefully.

many thanks.

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...
Modify modules/blockcategories/category-tree-branch.tpl and add {if $node.id != 1} to the start of the file and {/if} to the end of the file, where 1 is the id of the category you want this hide. This will hide that category and its subcategories, while making them still accessible by URL.

You'll need to modify category-tree-branch.tpl in your theme's directory too so that the categories are hidden from the sitemap.



Very helpful thanks Rocky, I was looking around in the blockcategories.tpl page trying to make the change there...!
Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...
  • 1 month later...
  • 1 year later...

Hi rocky,

 

Hiding the subcategories works great, thanks for that.

But I noticed that there's still a plus (or a minus) visible at the right of the parent category.

I think this will be quite confusing for customers.

 

 

Is there a way to remove this as well?

 

 

Thanks,

 

Steven

Link to comment
Share on other sites

  • 4 months later...

Rocky,

 

I feel that each times, when I needed this kind of help I fell on one of your excellent advices :lol:

Thank you so much !!

 

 

Rocky it works but only if Force Compile ON and Cache OFF. Once you switch back to production settings ForceComplie OFF and Cache ON it will display the hidden category again. Any ideas? PS1.4.6.2

Link to comment
Share on other sites

Rocky it works but only if Force Compile ON and Cache OFF. Once you switch back to production settings ForceComplie OFF and Cache ON it will display the hidden category again. Any ideas? PS1.4.6.2

 

OK SOLVED. This modification to hide categories does no force compile, so cache has to be cleared at:

yourshop/tools/smaty/compile

yourshop/tools/smaty/cache

*and just to make sure I cleared my browser cache too.

Works perfect! Thanks Rocky

Edited by comprausa (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...