Recent Topics

Where did you construct $product array [$product array is available in product detail page]

  • $product array in product detail page


    Basically, I want to add extra fields to this $product array

    product detail page

  • Hi @AkashWeybee,

    There is an abstract class in file i.e.,


    In that class please check, 'setProduct()' method.

    Please check them. If not then let me know.

  • @devansh419
    I want to append a few fields to this array.
    So Where do I need to make changes?

  • Hi @AkashWeybee,

    As I have seen the screenshot, you are trying to access the object.

    There is a 'index()' method in file name i.e. 'packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php'.

    There is a variable '$product' present in the 'if' case, if you want to add custom field than asign property like this,

    $product->extra_field_1 = 'Test 1';
    $product->extra_field_2 = 'Test 2';

    And then in the main view access the object like this.

    {{ $product->extra_field_1 }}
    {{ $product->extra_field_2 }}

Log in to reply