magento2.3 – After installing magento 2.3 there are no images and data anymore

I have cloned Magento 2.3 via this link to develop code and create a new element
Enter the description of the link here
But when I have finished installing, the homepage looks like this

Enter image description here

I have corrected the code in the folder lib internal Magento Framework View Element Template File Validator.php like this

$ realPath = str_replace (& # 39; \ & # 39 ;, & # 39; / & 39 ;, $ this-> fileDriver-> getRealPath ($ path));

But it has no change, no data, no picture.
If someone can have this problem for me, it will be very useful for me! You're welcome

magento 1.9 – Add or remove an option in the offer item

I had to create a controller that added or removed an option to a quote item.

I succeeded, but I could not convince the solution. I find it strange that I have to manage the correct completion of the option_id option. Can someone with experience tell me if there is a better solution?




// Add or optionally remove.
$ optionId = 1234; // ID optional.
$ optionData = $ product-> getOptionByid ($ optionId);
foreach ($ optionData-> getValues ​​() as $ v) {
$ optionId = $ v-> getOptionId ();
$ optionCode = 'option _ & # 39 ;. $ optionId;
$ itemOptionIds = $ quoteItem-> getOptionByCode (& # 39; option_ids & # 39;);

if ($ status) {
$ quoteItem-> addOption (new Varien_Object (new[
          'product' => $quoteItem->getProduct(),
          'code' => $optionCode,
          'value' => $v->getOptionTypeId()
          ])
);

if ($ itemOptionIds) {
$ optionIds = explode (& # 39;, & # 39 ;, $ itemOptionIds-> getValue ());
$ optionIds[] = $ optionId;
$ quoteItem-> getOptionByCode ('option_ids') -> setValue (implode (& # 39;, & # 39 ;, $ optionIds));
} else {
$ quoteItem-> addOption (new Varien_Object (new[
                'product' => $quoteItem->getProduct(),
                'code' => 'option_ids',
                'value' => $optionId
              ])
);
}
} else {
$ optionIds = [];
if ($ itemOptionIds) {
foreach (explode (& # 39;, & # 39 ;, $ itemOptionIds -> getValue ()) as $ itemOptionId) {
if ($ optionId === $ itemOptionId) {
$ quoteItem-> removeOption (& # 39; option_ & # 39;. $ optionId);
} else {
$ optionIds[] = $ itemOptionId;
}
}

if (! empty ($ optionIds)) {
$ quoteItem-> getOptionByCode ('option_ids') -> setValue (implode (& # 39;, & # 39 ;, $ optionIds));
} else {
$ quoteItem-> removeOption (& # 39; option_ids & # 39;);
}
}
}

$ quoteItem-> setDataChanges (true);
$ quoteItem-> save ();
}

// Save cart.
$ this -> _ getCart () -> save ();

magento2 – Magento 2 – Auth.net Sandbox is not working

Using Magento 2.2.4 – I have activated the payment method Auth.net Direct Post, applied the Magento Auth.net patch and with the configuration:

Gateway URL:

https://test.authorize.net/gateway/transact.dll

Transaction Details URL:

https://apitest.authorize.net/xml/v1/request.api

I see the transactions in the auth.net sandbox payment.log:

(TESTMODE) This transaction has been approved

but an error is thrown on the Magento page:

Please enter a transaction ID to authorize this payment

I have tried with activated and deactivated test mode. How can I do it right?

magento2 – Error creating a custom console command in Magento 2

I'll create a console command to enter values ​​into the database. There is an argument that lacks an error. I have gone through several tutorials, but for me code looks fine. The error is:

Not enough arguments (missing: "Credit, Amount has been credited").

Here is the console class:

Use Symfony  Component  Console  Command  Command.
Use Symfony  Component  Console  Input  InputArgument.
Use Symfony  Component  Console  Input  InputInterface.
Use Symfony  Component  Console  Output  OutputInterface.
Use Vendor  Module  Model  AmountFactory.

Class AddItem extends Command
{
const INPUT_KEY_ACTION = & # 39; credit & # 39 ;;
const INPUT_KEY_REFERENCE = & # 39; Amount has been credited & # 39 ;;
// const INPUT_KEY_AMOUNT = 50;

private $ amountFactory;

public function __construct (AmountFactory $ amountFactory)
{

$ this-> amountFactory = $ amountFactory;
parent :: __ construct ();

}

protected function configure ()
{

$ this-> setName (example: Credit: Refund & # 39;)
-> addArgument (
self :: INPUT_KEY_ACTION,
InputArgument :: REQUIRED,
& # 39; Action Name & # 39;
) -> addArgument (
self :: INPUT_KEY_REFERENCE,
InputArgument :: REQUIRED,
& # 39; Action Reference & # 39;
);
// $ this-> setDescription (# demo console command & # 39;);

parent :: configure ();
}
execute protected function (InputInterface $ input, OutputInterface $ output)
{
$ amount = $ this-> amountFactory-> create ();
$ amount-> setAction ($ input-> getArgument (self :: INPUT_KEY_ACTION));
$ amount-> setReference ($ input-> getArgument (self :: INPUT_KEY_REFERENCE));
// $ amount-> setAmount ($ input-> getArgument (self :: INPUT_KEY_AMOUNT));
$ amount-> setIsObjectNew (true);
$ amount-> save ();
return Cli :: RETURN_SUCCESS;
}
}

In di.xml:


   
       
           Vendor  Module  Console  Command  AddItem
       
   

If I comment out lines for a third argument, d. H. The amount, I get an error message

The argument "50" does not exist.

Can someone help find out this mistake? Many Thanks

magento 1.9 – Magento1.9.4: Images are not uploaded to admin – JSON in Syntax Error

I'm trying to upload a picture – something I've done a hundred times. Now it hangs when uploading.

  • I tried to disable extensions.
  • I did not make any changes.
  • There were no updates.
  • The pictures are 1.00mMb
  • I searched for existing zero size images
  • I have tried several browsers
  • I reindexed and emptied the cache
  • I tried the incognito mode

The mistake I get in the console is:

Unrecognized syntax error: Unexpected token <in JSON at position 0
at JSON.parse ()
at String.parseJSON [as evalJSON] (30fee76906a26cc4fffab3ed736897bb.js: 720)
at class.onFileSuccess (30fee76906a26cc4fffab3ed736897bb.js: 22344)
at d. (30fee76906a26cc4fffab3ed736897bb.js: 391)
at d. (30fee76906a26cc4fffab3ed736897bb.js: 21540)
at k (30fee76906a26cc4fffab3ed736897bb.js: 21540)
at d.fire (30fee76906a26cc4fffab3ed736897bb.js: 21540)
at e.chunkEvent (30fee76906a26cc4fffab3ed736897bb.js: 21540)
at f.event (30fee76906a26cc4fffab3ed736897bb.js: 21540)
XMLHttpRequest.doneHandler (30fee76906a26cc4fffab3ed736897bb.js: 21540)

For some reason, the strings are parsed "anonymously", resulting in an error. I am not sure if the problem is specific to the uploader.