Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jan
    @funkdoobiest
       /**
         * @var string
         *
         * @ES\Property(type="string")
         */
        public $_id;
    and
        /**
         * @var
         *
         * @ES\Property(type="string")
         */
        public $sku;
    sku is working
    id not
    Simonas Šerlinskas
    @saimaz
    did you set something to $_id for variant?
    Jan
    @funkdoobiest
    on ES it’s set:
    "variants": [
    {
    "_id": "1844",
    "entity_type_id": "4",
    "attribute_set_id": "10",
    "type_id": "simple",
    "attribute_set": "Edelmetalle",
    "sku": "7225",
    "created_at": "2013-02-21T15:36:52+01:00",
    "updated_at": "2014-01-09 09:25:19",
    "status": "1",
    "title": "Krügerrand",
    "description": "",
    "url": "/krugerrand-31-1g-1",
    "is_salable": true,
    "feingewicht": "31,1g (1 oz)",
    "feinheit": "916,6 / 1000",
    "weight": "1.0000",
    "mindestbestellwert": 1,
    "waehrung": null,
    "waehrungskuerzel": null,
    "category": [
    "4"
    ,
    "5"
    ,
    "9“
    ] …
    hm wait
    I will recreate index, just to be sure.
    Simonas Šerlinskas
    @saimaz
    can you try with different name than _id?
    and for the variant it should be used property
    not id annotation
    Jan
    @funkdoobiest
    i will try
    renamed it to „product_id“ and it’s working, thanks :)
    Simonas Šerlinskas
    @saimaz
    thats good to hear I could help
    but actually it has to work with id
    could you please create an issue about it and paste the elasticsearch structure
    Jan
    @funkdoobiest
    sure
    Simonas Šerlinskas
    @saimaz
    I will take a look later why _id or id isn’t working
    Jan
    @funkdoobiest
    sorry, did not have time to dig deeper in this problem
    but have an other question. how to map an array in elasticsearch document? is there an @ES\Property for this?
    it’s just an array of image urls
    so no need for a nested object
    Mantas Marcinkevičius
    @einorler
    You can just provide a property type string, it can hold a single or an array of strings
    Jan
    @funkdoobiest
    i see, thanks
    Mantas Marcinkevičius
    @einorler
    No problem
    Jan
    @funkdoobiest
    Hey
    I want to generate a url in twig template for a product variant
    but I am getting: Route 'The route object is fit for parsing to generate() method' not found")
    I’ve used „SeoAwareTrait"
    for the variant class
    any idea?
    in twig i am using: „path(variant)“. for a product it’s working
    Jan
    @funkdoobiest
    fixed it
    was my fault
    Jan
    @funkdoobiest
    hm no, not fixed.
    it’s working for product but not vor variant :(
    Mantas Marcinkevičius
    @einorler
    whats your data structure? How do you implement variants?
    Jan
    @funkdoobiest
    <?php
    
    namespace AppBundle\Document;
    
    use ONGR\ElasticsearchBundle\Annotation as ES;
    use ONGR\RouterBundle\Document\SeoAwareTrait;
    use ONGR\RouterBundle\Document\SeoAwareInterface;
    
    
    /**
     * @ES\Nested
     */
    class ProductVariant implements SeoAwareInterface
    {
        use SeoAwareTrait;
    }
    Mantas Marcinkevičius
    @einorler
    hmm...
    Jan
    @funkdoobiest
    'Route 'The route object is fit for parsing to generate() method' not found': Document is not correct or route cannot be generated.
    Mantas Marcinkevičius
    @einorler
    i would suggest simply using a link to a product with a correct id of a variant in the requst query and let the twig handle the correct variant to display
    Jan
    @funkdoobiest
    we need real urls for SEO
    Mantas Marcinkevičius
    @einorler
    that way you wouldnt need to use the trait in the variant at all
    it is a real url to a product
    Jan
    @funkdoobiest
    yes, but not the same as before
    and I need this specific urls for seo
    Mantas Marcinkevičius
    @einorler
    difficult to say whats wrong in your situation, but it may be that if you insist on having the urls generated for variants and the problem is deeper, it may be that you will need to create a custom router
    the shrot description on how to do it is in the docs right now, a lot more in depth one will be accessible in the docs shortly