Hello team !
I’m quite new to the univers of web dev, and i found your pluggin/theme realy helpfull for a good base.
But now i’m trying to adapt the theme to what i have in mind, and so my first objective is to add a button to all listing, in the main block and in the main page slot. i want the button to be able to do some custom thing, like take the visitor information, and add it to a list in the data base, stuff like this. Juste a button that can fire custom script.
You can add a button using the attribute listing, please check this sample How to add a WhatsApp button - HivePress Help Center. But note that adding a script and other settings will require custom implementation.
Thx but it seams that when a use créate a listing, they need to do it manualy no ? in my case i want to set a button to all the listing that can’t be editing, and that can run script like
-right the id of the user, the id of the article and a value (number) in a data base table
-add the article in a page, listing all the listing that have been add by the user
…
I don’t know if the atribute solution can do all of that.
Thx for the quick respond btx
Unfortunately, there’s no such feature, it would require a custom implementation. If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY
Ok tht so i’m gonna try to make a “extension” that can add all the features that i need.
Also i’m looking for the good hook and files to add my button, but i have some trouble finding it, i want the button to appear on the main block of the listing et on the main page, (were the price is located)
So i’m trying to add just a text for testing purpose in the includes/template listing_view_page (in the page_sidebar précisly), so i’m using the hook hivepress/v1/templates/listing_view_page/blocks it’s that correct?
Sorry for the inconvenience, but customization is beyond our support scope - it includes fixing bugs and guidance about the available features Support Policy | HivePress
Ok no problem i found a way to do what i want anyway.
So now i have just a small question, i créated an attribute for the listing creation (it’s a value) and i want to save this value in the database, so i can reuse it later for some script. but i can’t find it, i don’t even know if it’s save in the database. can you help me with it ?
If it is not a selective attribute, it is stored as a post meta with a hp_ prefix. If it is a selective attribute, for example, radio checkbox or select, it is stored as custom taxonomy with the hp_ prefix. If you have a listing object, then you can get it this way $listing->get_attributenamehere().
Sorry to bother you every time but now i’m having an other request
i need to prevent user to edit some attribute of there listing, is there an easy way to do that ?
I have an attribut that allow user to set the price of there item, but i don’t want theme to be able to update the value after the listing is set to public.
I don’t know if it’s enought info, tell me if you need more
Also i would like to know were are stored the attribute value on the database, i saw that some of the original attribute are stored in the post table, but some that i add aren’t
also just for precise, i can also modify the hivepress plugin files (i know that if i do so i’ll be unable tu update the plugin but it’s not a problem)
i see, but the problem is that it change the listing statut to draft again, and we don’t have the original value, before the edit, So i think i’m gonna try to completly desable the edit option of all the listings, is there a snippet for that purpous or an easy way ?
i’m talking about the walue of the attribut in each listing
The problem is that the catégorie, the price, and the name of the vendor are in the same column post_excerpt, and i want to use the value of the price, but there are some space in the middle of the value (ex: 651 986) so m’y script can’t read the full value, it just see the first digit (651). so if you have an advice for that that could be realy helpfull
Sorry for the inconvenience, but customization is beyond our support scope - it includes fixing bugs and guidance about the available features Support Policy | HivePress
If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY
It is displayed in post_excerpt only if you have marked the attribute as indexable (this is necessary for search), and the attribute values (if it is not a selectable attribute) are stored in wp_postmeta.