category url format in nopcommerce - asp.net

I would like to know how I can make the url's for the categories static. For example http://localhost:3547/category/53-cellphones.aspx is what I have currently but yesterday it was http://localhost:3547/category/1-cellphones.aspx.
I want to know how can I make the number in the category name static, e.g. 1-cellphones.aspx to be like that all the time, I don't want to be changed tomorrow to 3-cellphones.aspx for example.
Is that possible?
Thanks

This is normally the id of the category in the database.
Can you check the Nop_Category table and check you don't have duplicate rows.

Related

Wordpress /page_id= order

When using plan structure link like: https://example.com/?p=123
Wordpress gives random number, not by the order. In some cases I need to know the page id in advance. So is there are any way to get rid of the order WP gives to the link id?

Merge ACF fields into another ACF field

I'm building an athlete profile database using ACF (Advanced Custom Fields). I have fields for First Name, Last Name, and Full Name. Athletes will be able to enter their first and last names on the front end of the website when they are creating a profile. I don't want them to enter their full name also because that's a bad user experience. But I need the full name on the backend. Is there a way to have the Full Name text field auto-generated by merging the values of First Name and Last Name? I don't want to enter the full name manually. Thanks!
with this kind of thing you are wanting to combine 2 fields into 1 record it may just be easier to ask for the full name in 1 field this is not a bad user experience as much as you may think more people actually find it more annoying needing to put different parts of there name in different boxes.
However if this is what you are wanting to move forward with I did find this which may be of some assistance Wordpress/ACF merging multiple fields value to one

Generate and display html table with user data from wordpress

Update: With the help of the answerer below I figured out how to do this. Basically I used a WP Query to get users and their user metadata and I sorted and placed the data in a for each loop in a table.
I'm new to PHP and I need some help. Basically I want to create a leaderboard with different user data. I want to display it in an html table.
This is kinda what i want:
Username GamiPress Points Time since last login
And I want the table to be populated with these data amongst others automatically. I want two versions one that is sorted with the 15 users who have the most points and one that sorts on the 15 users that logged in last.
Can someone point me to the right place on how I can best implement this?
I basically want to create the GamiPress Leaderboard add-on that I, unfortunately, can't afford, but with some extra fields.
There are multiple steps to do if you want to achieve this:
1) Add meta field to your users, so you can store the points. For example you can use "Advanced Custom Fields" plugin for this.
2) Write a function for adding points to this field. Define when this function will be fired.
3) Query the users ordered by that meta value and display it (get_users($args) might be useful).
4) For the Last-Login value you can use a plugin (google Wordpress Last Login) and write another Query and order results by that meta field. You can also write this by your own, here is a link I found: https://www.wpbeginner.com/plugins/how-to-show-users-last-login-date-in-wordpress/
I don't know if this is what you were looking for.
Or did you want to see an example code how you use a wp query and display data in html table?

Wordpress search including multiple categories

I have a search form that has a text field and 3 drop downs, that have categories. What I'm trying to achieve is the current search query that posts appears as follows:
?s=Milk&cat=4&cat=7&cat=15.
What I'm trying to achieve is something like:
?s=Milk&cat=04,7,15
I'm relatively new to WordPress and PHP and haven't been able to find any good documentation or references to what I need to do to accomplish this.
I don't necessarily want the answer, just some guidance in the right direction.
This was already answer: multiple categories query
It must be like this:
/?cat=970,971,972 where the # is the cat id.

Wordpress order categories

I have a Wordpress site where a lot of the categories are peoples names. The slug becomes john-smith fred-wilkinson etc by default. So the category list is in alphabetical order by their first name. I would like them to list by last name.
I could get the authors/editors to change the slug to wilkinson-fred etc but I would rather have a solution that they don't have to alter the default slug.
I know there are plug-ins that you can drag and drop to any order you want. Again this relies on the author/editor putting it in the right place.
My slugs currently look like this
john-smith
fred-wilkinson
Alan-t-jones
etc
I have other categories that I don't want to alter. I only want to reorder where the parent category is "artist".
Any ideas? If I put wilkinson-fred in the description field can I sort on that?
Thanks
I assume that you want to change the order of wp list categories function output (maybe make it a little clearer in your future SO questions!). If that's so, I think you have two options here:
1) Hijack the orderby parameter as mentioned in this answer by #Chris_O at Wordpress Stackexchange:
There is an unused column, term_order, in the wp_term_relationships table that you can use to assign a custom order to the terms within your taxonomy. The order is set at 0 by default and it will take a custom query to get the order back and another solution to set the order.
Although as #Kaiser mentions in the comments to the answer, this sollution is a little hacky as it's not meant to be used this way and its implemantation may change in future releases of Wordpress.
2) Store the output of the function in varible (echo => false under $args), manipulate the output and print the resulting array. This is the way I would choose as it makes you more in control of the situation.

Resources