refactored checkout workflow with stripe
This commit is contained in:
@@ -106,7 +106,7 @@ function materio_home_entity_bundle_field_info(EntityTypeInterface $entity_type,
|
||||
->setTargetEntityTypeId($entity_type->id())
|
||||
// // The Entity Type bundle this field belongs to.
|
||||
->setTargetBundle($bundle)
|
||||
->setSetting('target_type', 'commerce_product_variation')
|
||||
->setSetting('target_type', 'commerce_product')
|
||||
->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)
|
||||
->setComputed(TRUE)
|
||||
->setRevisionable(FALSE)
|
||||
@@ -116,7 +116,7 @@ function materio_home_entity_bundle_field_info(EntityTypeInterface $entity_type,
|
||||
'label' => 'hidden',
|
||||
'weight' => -5,
|
||||
])
|
||||
->setClass(\Drupal\materio_home\Plugin\Field\FieldType\ComputedProdVariationsReferences::class);
|
||||
->setClass(\Drupal\materio_home\Plugin\Field\FieldType\ComputedCommerceProductReferences::class);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@ use Drupal\Core\TypedData\ComputedItemListTrait;
|
||||
// https://www.cornel.co/article/entity-reference-computed-field-example-drupal
|
||||
// https://www.caxy.com/blog/drupal-custom-form-and-computed-fields
|
||||
|
||||
class ComputedProdVariationsReferences extends EntityReferenceFieldItemList
|
||||
class ComputedCommerceProductReferences extends EntityReferenceFieldItemList
|
||||
{
|
||||
use ComputedItemListTrait;
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ class ComputedProdVariationsReferences extends EntityReferenceFieldItemList
|
||||
* Compute the values.
|
||||
*/
|
||||
protected function computeValue() {
|
||||
$query = \Drupal::entityQuery('commerce_product_variation')
|
||||
$query = \Drupal::entityQuery('commerce_product')
|
||||
->condition('status', 1)
|
||||
->sort('created', 'ASC')
|
||||
// ->exists('field_visuel')
|
@@ -50,7 +50,9 @@ function materio_user_form_user_modal_form_alter(&$form, FormStateInterface $for
|
||||
|
||||
$form['actions']['submit']['#attributes'] = array(
|
||||
"@click.prevent" => "register",
|
||||
"@keyup.enter" => "register"
|
||||
"@keyup.enter" => "register",
|
||||
"ref" => "register"
|
||||
// ":class" => "can_register"
|
||||
);
|
||||
|
||||
}
|
||||
@@ -59,7 +61,8 @@ function _materio_user_process_password_confirm($element){
|
||||
// ksm($element);
|
||||
$element['pass1']['#attributes'] += array(
|
||||
"v-model" => "pass1",
|
||||
"placeholder" => $element['pass1']['#title']
|
||||
"placeholder" => $element['pass1']['#title'],
|
||||
":class" => "psswd_class"
|
||||
);
|
||||
$element['pass2']['#attributes'] += array(
|
||||
"v-model" => "pass2",
|
||||
|
Reference in New Issue
Block a user