When you first setup the POS and haven't created a register yet, you are shown an empty dropdown to select a register from. This should be updated to

  • Not show the dropdown and select register button
  • Show a link and message to add a register

Comments

smccabe created an issue. See original summary.

shabana.navas’s picture

Assigned: Unassigned » shabana.navas
shabana.navas’s picture

Status: Active » Needs review
StatusFileSize
new962 bytes
new41.72 KB
new40.71 KB

There's no shame in working on low-hanging fruit.

Aanal.addweb’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new43.2 KB

@shabana.navas, Thanks for Providing a fruitful patch, It works well for me & after applying the patch it shows added text with the link and after adding the register, it shows me the register dropdown with a Registered name.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/src/Form/RegisterSelectForm.php
@@ -26,6 +27,12 @@ class RegisterSelectForm extends FormBase implements FormInterface {
+      $link = Link::createFromRoute('Add a new register.', 'entity.commerce_pos_register.add_form');
+      $form['warning'] = [
+        '#markup' => $this->t("POS Orders can't be created until a register has been created. @link", ['@link' => $link->toString()]),
+      ];

How about using drupal_set_message(MESSAGE_TEXT, 'error');

I think this is an error and using drupaL_set_message() will appropriately style the message.

Also this is not the best way to put a link into a message because the context and link text can't be translated. Something like this would work better:

  drupal_set_message(
    $this->t('POS Orders can't be created until a register has been created. <a href=":url">Create a register</a>.',
    [':url' => Url::fromRoute('entity.commerce_pos_register.add_form')]
  );

This way the translator can translate everything in context and it is easier for right-to-left languages too.

shabana.navas’s picture

Assigned: shabana.navas » Unassigned
sorabh.v6’s picture

Assigned: Unassigned » sorabh.v6

Working on it.

sorabh.v6’s picture

Assigned: sorabh.v6 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.04 KB
new937 bytes

Patchfile and interdiff posted with the change suggested in #5. Please review.

Thanks

smccabe’s picture

Status: Needs review » Fixed

Thanks all, committed

  • smccabe committed dc3ec59 on 8.x-2.x authored by sorabh.v6
    Issue #2923176 by shabana.navas, sorabh.v6, dhwani.addweb: No Register...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.