Jump to content

Is it possible to add a new "object type"


Recommended Posts

Hello,

I was able to add new fields in a site that I worked on a few months ago, on Perstashop 1.6.x. I think it's more or less the same thing in Prestashop 1.7. And if it's not I guess I can easily find out how to do.

But here I would need to add a specific field. The shop will be about books, so my products will be books, and I need to add a new field for the authors. 

But I also need to be able to manage authors and add a biography for each one. 

That's why "author" won't be a simple text field in my product, it has to be something more complex.

Do you see what I mean ? 

Any idea how to handle this in Prestashop 1.7 ?

Thanks for your help.

Share this post


Link to post
Share on other sites

I finally found out that I need to use product caracteristics (I'm not sure if it's the right term, it's "caractéristique" on my site in french, next to product attributes).

So the idea is to be able to add a new field into a product caracteristic. 

I already found a tutorial on how to add new field to product attribute. Is it the same thing for caracteristics ?

Share this post


Link to post
Share on other sites

In english, PS "caractéritisques" are attributes. But PS attributes are not designed to manage many different values. Eg if you create an attribute "color", you will have may be 10 different values (red, blue...). If you create an attribute "author", you may have a very large number of different values, depending on the size of your shop.The build-in mechanism to navigate, search (FO) and manage (BO)  won't fit anymore.

That's why I ended up creating custom modules, overrides, search provider, new tables, templates.... for my shop.

Share this post


Link to post
Share on other sites

Thank you Pierre. 

In this case I would have to create a new type called "Author" and add it into the database and create new menu items to manage the authors, is it what you meant ?

I understand that you already did these kind of things for your shop, could you please help me a bit ?

And also I add a question about the author page: I wanted to create a new page that would list all the authors of the site. But I didn't want it to be like:

http://mydomain/modules/mycustommodule/controller_name

I'd like to have something like:

http://mydoamin/auteurs

I was told to handle this in SEO & URL but I don't know how... I posted the topic here:

https://www.prestashop.com/forums/topic/641041-adding-a-new-page-with-custom-code/

 

Do you have any idea ?

Thanks again

Share this post


Link to post
Share on other sites

Yes, you could also try with brands and see if it does the job.

About your specific question on url, what you want is a friendly URL (URL simplifiée) for your authors. You can configure this in the BO.

I'm currently writing a series of technical articles about the custom code I've developed for my last Prestashop project: the FadeurParts;be webshop. The first 4 can be read on my brand new website : https://okai.be/articles-techniques/.

Share this post


Link to post
Share on other sites

I'm not really willing to use the brands. It's a good idea, thank you, but i'd rather have something more customized.

That's why I think I should create a new object type. 

I will carefully read your articles Pierre, but do you think you could give me a little help ?

I'm not asking for someone to develop for me, I'm a developper myself and willing to learn, that's all. 

But it's always easier to learn from someone who knows the subject.

Thanks

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More