# |
Apr 9th 2019, 09:19 |
spriz |
I’ll have more actually @rogerpro :slightly_smiling_face: `alternative`, `replacement`, `related´, `often_bought_with` etc |
# |
Apr 9th 2019, 09:18 |
rogerpro |
@neon1024 I understood @spriz is going to have only 1 product association type (“alternative product”) so why is association_type_id for? |
# |
Apr 9th 2019, 08:42 |
palak.vasani25 |
I believe CakePHP doesn't support namespace |
# |
Apr 9th 2019, 08:41 |
palak.vasani25 |
Hi Everyone, I am trying to integrate Razorpay with Cakephp 2. Can anyone help me to place Razorphp SDK in proper place with CakePHP Structure and use it |
# |
Apr 9th 2019, 08:31 |
dereuromark |
why not Form->text() etc then? those produce nothing else. ->control() sure does add the div. |
# |
Apr 9th 2019, 08:18 |
conehead |
I only need the input tag and nothing else. But the template is used for this. And it contains a div around it which will still be rendered |
# |
Apr 9th 2019, 07:58 |
admad |
Form->hidden() would just generate the input tag nothing else, so you actually went in the opposite direction to achieve want you want |
# |
Apr 9th 2019, 07:58 |
conehead |
@admad ah thanks. already tried that. Had to change from Form->hidden to Form->control to get it to work |
# |
Apr 9th 2019, 07:58 |
admad |
@conehead use the 'template' key in options to override required template(s) |
# |
Apr 9th 2019, 07:58 |
admad |
cast your votes guys https://github.com/cakephp/cakephp/issues/13103 :slightly_smiling_face: |
# |
Apr 9th 2019, 07:43 |
conehead |
is it possible to disable a form template for a single field? I get several divs around an hidden field :S |
# |
Apr 9th 2019, 07:24 |
spriz |
that’s a good #dislacimer |
# |
Apr 9th 2019, 07:24 |
spriz |
:,) |
# |
Apr 9th 2019, 07:24 |
neon1024 |
I will qualify it that I’ve just arrived at work and haven’t had a coffee yet! :P |
# |
Apr 9th 2019, 07:24 |
spriz |
Yeah, I think I will :slightly_smiling_face: |
# |
Apr 9th 2019, 07:24 |
spriz |
I’ll explore youre idea and check pros and cons though |
# |
Apr 9th 2019, 07:24 |
neon1024 |
Give it a go in a branch perhaps and bake some stuff, see how you like it |
# |
Apr 9th 2019, 07:23 |
spriz |
Just `Products BelongsToMany Products through RelatedProducts` - same same though |
# |
Apr 9th 2019, 07:23 |
spriz |
That was my original idea |
# |
Apr 9th 2019, 07:23 |
neon1024 |
..and the store the association type in the join table? :man-shrugging: |
# |
Apr 9th 2019, 07:23 |
neon1024 |
Perhaps Products hasAndBelongsToMany Products Through AssociatedProducts |
# |
Apr 9th 2019, 07:22 |
neon1024 |
Or maybe I’m wrong. Perhaps you just want a hasAndBelongsToMany Through |
# |
Apr 9th 2019, 07:22 |
neon1024 |
Perhaps I explained it badly! :P |
# |
Apr 9th 2019, 07:22 |
neon1024 |
That’s the many-to-many part, so you can have the products to choose from :slightly_smiling_face: |
# |
Apr 9th 2019, 07:21 |
spriz |
thanks though! |
# |
Apr 9th 2019, 07:21 |
spriz |
I have to draw it to understand I think :P |
# |
Apr 9th 2019, 07:21 |
neon1024 |
They would be |
# |
Apr 9th 2019, 07:21 |
neon1024 |
That would be my approach anyway :slightly_smiling_face: |
# |
Apr 9th 2019, 07:21 |
spriz |
but those AssociatedProduct need to be other `Product`entities |
# |
Apr 9th 2019, 07:21 |
neon1024 |
Then you could customise the property name depending on the AssociatedProductTypes.name |
# |
Apr 9th 2019, 07:21 |
neon1024 |
So then I’d have a product, and a nice ’associated_products` entity property with an array of products |
# |
Apr 9th 2019, 07:20 |
neon1024 |
`$this->Products->find()->contain(['AssociatedProducts' => function (Query $q) { return $q->where(['AssociatedProducts.association_type_id' => 1]); } ]);` |
# |
Apr 9th 2019, 07:20 |
spriz |
Ah I see |
# |
Apr 9th 2019, 07:19 |
neon1024 |
Product hasMany AssociatedProduct |
# |
Apr 9th 2019, 07:19 |
neon1024 |
AssociatedProduct belongsTo Product |
# |
Apr 9th 2019, 07:19 |
neon1024 |
Many rows |
# |
Apr 9th 2019, 07:19 |
neon1024 |
As the association would be to the product |
# |
Apr 9th 2019, 07:19 |
spriz |
then how would that link 2 products :thinking_face: ? |
# |
Apr 9th 2019, 07:18 |
neon1024 |
It would only have product_id |
# |
Apr 9th 2019, 07:18 |
neon1024 |
It would not, no. |
# |
Apr 9th 2019, 07:18 |
neon1024 |
Then I could get any product, and get all it’s associations by type |