Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Paul A 133 posts 368 karma points
    Mar 30, 2014 @ 15:00
    Paul A
    0

    Link to products from variants list

    Hi, 

    I'm cycling through all variations of products (each course date available),,, how do I then link to that course from within

    @foreach (var product in sorted    )
    {
    var url = CatalogLibrary.GetNiceUrlForProduct(product, categoryID);

    This currently sends me to a 'product not available' message. 

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Mar 31, 2014 @ 13:14
    Nickolaj Lundgreen
    0

    Could one of the sorted products be null? Also GetNiceUrlForProduct only takes entities, not ID's ? (or is it just a bad variable name 'categoryID')

  • Paul A 133 posts 368 karma points
    Apr 01, 2014 @ 01:24
    Paul A
    0

    Sorry, typo, those params are (product, category). Category is correct, I only have one, set like this:

    @{var category = Category.All().Single(x => x.CategoryId == 77);}

    The courses are all being listed, with each variant available being pulled through correctly. I have start date, end date and "date as text" as variant fields. These are being listed correctly:

    • CourseName1, 1st-3rd Jan
    • CourseName1, 2nd-4th Feb
    • CourseName1, 3rd-5th Mar
    • CourseName2, 25th Dec
    • CourseName2, 26th Dec
    But clicking any of these loads message "The item you are looking for is not available at the moment". If I try to access a course page via the 'list products in category' code, they load fine. 
    This works (normal product link) domain.com/catalog/courses/coursename/c-24/c-77/p-1213
    This doesn't (variant link) domain.com/catalog/courses/coursename/c-24/c-77/p-1333#1333
    Thanks for any help, 
  • Paul A 133 posts 368 karma points
    Apr 01, 2014 @ 23:41
    Paul A
    0

    In short:

    How do I list all product variants in one big list, and link to each?

  • Paul A 133 posts 368 karma points
    Apr 01, 2014 @ 23:59
    Paul A
    0

    Same problem with:

    var url = CatalogLibrary.GetNiceUrlForVariant(variant, category, category.ProductCatalog);
  • Paul A 133 posts 368 karma points
    Apr 03, 2014 @ 00:22
    Paul A
    100

    For any other beginners... ParentProduct

    var url = CatalogLibrary.GetNiceUrlForProduct(product.ParentProduct, myCategory);

     

Please Sign in or register to post replies

Write your reply to:

Draft