Issue while including category name in url "{cate-name}/{se-name}" in category landing page in Nop Commerce - nopcommerce

I am using nopcommerce 3.40 and i want to include Parent category name in url of category landing page which i can able to do by
adding parent category name manually in sename from admin side while creating category for example i have Parent category saree then in sename i am giving like "saree/test"
and adding below code in
Nop.web\Infrastructure\GenericUrlRouteProvider.cs
routes.MapGenericPathRoute("AllUrls1",
"{*generic_se_name}",
new { controller = "Common", action = "GenericUrl" },
new[] { "Nop.Web.Controllers" });
this way i am able to get my result.But its making problem in checkout page(i am using one page checkout).Problem is after billing address selection instead of going to shipping address section its redirecting to cart page.
Is there anything i need to do extra that i am missing for this issue or any other way to get url i want for category landing page?

You can't do this like this way best way to do this is to modify code in the nopCommerce route handler. Go to below file and modify it.
/Presentation/Nop.Web.Framework/Seo/GenericPathRoute.cs

Related

I want to link group of custom fields to specific page only... not for all pages

I'm new to pod plugin. When I add custom fields, all fields are coming for all pages. I want to link specific field to specific page only.
When I try to add new fields, it does not give me any option to link that field to specific page.

How to Display Only Parent Category in Post Url Wordpress

I'm New to WordPress and building an Multiple Choice Question Database Website. As you can see the post URL in Quite Long and Causing SEO Problems. I want to trim this url by only showing the parent category and post title in the link (i.e mcqs). I'm using a Hierarchical style categories.
MCQS (Parent)
-10th Class MCQS (Child)
--10th Class Chemistry MCQS (Child)
CURRENT URL http://fgstudy.com/mcqs/10th-class-mcqs/10th-class-chemistry-mcqs/10th-class-chemistry-mcqs-water
URL I NEED http://fgstudy.com/mcqs/10th-class-chemistry-mcqs-water/
Simply Edit Post and Select MCQS (Category You Like) as the PRIMARY CATEGORY Update Post and DONE.
View Image Here

Kentico - Setting priority order of document aliases / rewrite rules

I have a Kentico e-commerce website with the following tree structure:
Products
My Category 1 (Category page)
My Product 1 (Product page)
My Product 2 (Product page)
Categories can be accessed by any combination of the following URL’s:
/my-category-1/red (Filters)
/my-category-1/plain/red (Filters)
/my-category-2/patterned/red/plain (Filters)
This is achieved by setting up a 'route' against the 'My Category 1' category with the path/pattern '/my-category-1/{*categories}'
We also have a requirement to be able to access products via the URL’s
/my-category-1/my-product-1
/my-category-2/my-product-2
These pages are never hit however because of the route setup against the category pages.
Does anyone have any advise of how this could be achieved whilst maintaining the desired url structure? I'm trying to avoid a scenario whereby I have to perform a database check of whether a page is a product or not.
Is there anyway to 'prioritise' routing in Kentico?
Your product URL /my-category-1/my-product-1 falls under /my-category-1/{*categories}, so system will always take you to the category page trying to apply some filter. You just need to put different URL templates for those pages, e.g.:
Product page:
/product/my-category-1/my-product-1
/my-category-1/product/my-product-1
If don't want to set product page URL like above, you have to URL template for Category with filter, e.g:
/my-category-1/filter/{*categories}
This is not that much of Kentico problem, but routing. You can get more details on routing here.

WordPress category link

I am trying to create an online store from scratch, with categories and product pages.
Since is my first WordPress store I'm stuck on this trivial problem which stopped me on my way.
The permalinks are set to Month and name just to know the settings.
I created several categories where I want to insert the future products.
The problem arise when I try to access a certain category link - www.mysite.com/category/books/ - it displays the error page.
If I access www.mysite.com/category/ it shows me the content of the category page created in the admin panel.
All I want to do is to display all books when the visitor clicks on www.mysite.com/category/books/ and so on.
It is simple. Go to wp-admin/options-permalink.php and make your own settings: /%category%/%postname%/
And add a prefix on the field below: category or whatever you want
Read here for more options
Actually I solved it in another way, by modifying the category.php page.
There I inserted this code :
$uri = $_SERVER['REQUEST_URI'];
$elms = explode('/', $uri) ;
$catName = $elms[4] ;
and it does the thing I need.

Is there a Drupal module that can redirect from root URL to a certain page?

I wonder if there's a Drupal module that can do this kind of functionality: if i go to home page, it will take me to some subpath within the site. i.e. www.something.com will redirect to www.something.com/product/node/11.
I tried creating an alias and used Path redirect module but for some reason, i can't reach the expanded URL when going to home page. it will display the content of www.something.com/product/node/11 but still using www.something.com.
I'm thinking that this can only be implemented in Apache server, not inside Drupal?
Note that our purpose of doing this feature is whenever a new product is created, we want our home website to point to that (i.e. www.something.com -> www.something.com/product2/home, before www.something.com/product1/home). If this is configurable inside Drupal, the changes would be easier and can be done by a Drupal administrator.
You should be able to go to /admin/settings/site-information and set the Default Front Page at the bottom of the form. That doesn't do a redirect: the home page will BE whatever you set the default to.
Create a new view (Node type) named "frontpage_redirect"
As suggested in answer by Michael D, create and save a view configured to search for your specified criteria:
display: page display, path = frontpage-redirect
pager: 1 item
row style = Fields
fields: Node => Node ID
filters: node type = product
sort: post date desc
Save your new view
At admin/config/system/site-information, set your "Default front page" to the view display path above (frontpage-redirect in my example)
In the view edit screen select "Theme: Information" link in the Page display. Look for the most specific (rightmost) entry under "Field Node: Nid (ID: nid)" - should be something like views-view-field--frontpage-redirect--page-1--nid.tpl.php, but will depend on the view name and display name. Copy the default views template views-view.tpl.php into your theme folder using the filename from 3.
Edit the template and put this code in it:
if (isset($row->nid)) {
drupal_goto('node/' . $row->nid);
}
This way of setting up the redirect lets you drive it from Views, which gives flexibility. When your customer decides in six weeks that they want to feature only the latest red product on the frontpage, you'll be able to update the logic behind the redirect using the views UI. (And you can do it from your phone on the train home!)
You avoid the need to create a custom module (which is easy enough, but does add some complexity) or to move your site logic into .htaccess.
Using the Views module, create a new view that displays one full node, ordered by last created, filtered appropriately, then create a page display in the view. Then follow Graham's instruction to set the site homepage to the view URL.
Another way would be to write a very simple custom module that db-queries for the latest node created of the sort you want, grab the URL to the page, then redirect there using drupal_goto().
There are other ways to do what you want inside Drupal, but I can't think of any that are more direct and simple at the moment...
What you are asking seems wrong. Sorry if I misunderstand some detail, but it seems you should reconsider the problem on a higher level.
If I understand you right, you want to show the page for the latest product as the homepage?
If so, maybe you should turn that into show the latest project page on the homepage. That fits a lot better with the RESTfullness of the web. And with expectations of the users.
The pattern would then be:
GET /products/22 shows product 22
GET /products/23 shows product 23
GET /product/latest shows the last product (in this case, the page would be exactly similar to /products/23)
To achieve that, you can use views module.
On similar lines to Michael D's post, assuming you want to pull the most recently published product from a custom content type called "products," you could put something like this in your settings.php:
function yourtheme_preprocess_page(&$variables) {
$query = db_query("SELECT nid FROM {content_type_products} ORDER BY nid DESC LIMIT 1");
while ($row = db_fetch_object($query)) {
$redirect_nid = $row->nid;
}
if ($variables['is_front'] == 1) drupal_goto("/node/" . $redirect_nid);
}
modify the .htaccess file.
http://drupal.org/node/50322#comment-2456576

Resources