texts: Media image attribute bugged in frontend

texts:
Reposting my question from another forum:
I want to add a picture as attribute on product and category page but encountered a problem.

Using Media Image custom attribute type I could not display it on frontend and backend.

After that I use Google and found that the storefront properties in Media Image attribute is bugged and hidden.

Made them visisble, set the image for attribute using aaaand i got the end of image link as text in attribute field in frontend

also i use my code

$attributeName = $_product->getResource()->getAttribute('color_unc');
       if ($attributeName) {
          $labelValue = $attributeName->getFrontend()->getValue($_product);
          $labelName = $attributeName->getFrontend()->getLabel($_product);
                                          }

echo $labelName; echo ' ';echo $labelValue;

in category phtml file and expectedly received the same text

Maybe anyone know how to fix this and get the image instead of text?
I will say right away: i want use this for configurable product which have only one color (i can't use swathes for obvious reasons)


texts:
I have 2 product review for same product.

I can get the rating summary for product.

$this->_reviewFactory->create()->getEntitySummary($product, $this->_storeManager->getStore()->getId());
           echo $ratingSummary = $product->getRatingSummary()->getRatingSummary();exit;

But I need to get rating summary for each review for same product.

How to do that ..

Thanks


texts:
I hope you are working well.

Magento 2.1.5

I need help how to override category h1 title with custom category attribute, without affecting product page title.

Thanks and appreciate if you can help me.


texts: How to change the coupon code success message Magento 2

texts: How do I change the coupon code message?


texts: How to rename the browser tab for customer login page magento2

texts:
I am using magento 2.3.
I want the browser tab to say something like: 'seller login instead of customer login'.


texts: Magento 2 how to read the uploaded csv from front end form

texts:
Here am trying to read the csv file which is uploaded by frontend form.
but am not able to open or read the file content.
here is form file code.
<form class="import-shipping-form" action="http://website.co/zone_customer/Index/UploadCsv" method="POST" >
  <?php echo $block->getBlockHtml('formkey'); ?>
    <input type="file" required class="required-entry" name="my_custom_file" id="my_custom_file" />
    <button type="submit">Import</button>
</form>

This is the controller
app/code/Zone/Customer/Controller/Index/UploadCsv.php

<?php
namespace Zone\Controller\Index;

class UploadCsv extends \Magento\Framework\App\Action\Action
{
    protected $resultPageFactory;
    protected $jsonHelper;
    protected $_fileUploaderFactory;
    protected $csvProcessor;
public function __construct(
        \Magento\Framework\File\Csv $csvProcessor,
        \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory,
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory,
        \Magento\Framework\Json\Helper\Data $jsonHelper
    ) {
        $this->csvProcessor = $csvProcessor;
        $this->_fileUploaderFactory = $fileUploaderFactory;
        $this->resultPageFactory = $resultPageFactory;
        $this->jsonHelper = $jsonHelper;
        parent::__construct($context);
    }
     public function execute()
    {
       $data = $this->getRequest()->getPostValue();
       try{
            if(isset($data['my_custom_file']['0'])) {
            $importProductRawData = $this->csvProcessor->getData($data['my_custom_file']);
             foreach ($importProductRawData as $rowIndex => $dataRow) {
                 print_r($dataRow);
             }
          } catch (\Exception $e) {
            $this->messageManager->addError($e->getMessage());
         }
    }
}

Where am doing wrong. Can I get Help? Thank you in advance.


texts: Magento 2 Which controller is used for Place Order

texts:
I find myself unable to place orders.

I wish to debug this.

Which controller is invoked/used when the place order button is clicked?
I would like to put a break point and start from there thanks.


texts: Form validation with Custom error placement in magento2

texts: In my form i need to show validation message of specific field in my predefined or specific div, how to do it in Magento2?


texts: Magento 1.9 : How to get the total price of products added to cart based on product Attribute?

texts:
I'm currently working on a Magento extension where I need help in getting the total price of all products having the same attribute when they are added to the cart.

Here is my code for a better explanation @ the shipping's carrier page:

foreach ($this->_quote->getAllItems() as $item) {

        $productid = $item->getProductId();

        $product = Mage::getModel('catalog/product')->load($productid);

     $chilledFood = $product->getData('is_chilled_food'); // the custom attribute 'is_chilled' added to product backend, so if the product is chilled, the value will be 'yes'
        if ($chilledFood) {  // need help from here?
            return $this->_price = ' ';
        }

    }

So I need help on knowing if the customer selects chilled food in the cart. If yes, the shipping price will be an additional $5 from other types of food category. BUT there will be free shipping cost if the total chilled food amounts to $50 and above.

Thank you.


texts: How can I have one login page for 2 stores?

texts:
My Magento installation will be split into 2 websites with different currencies and different prices (think: Canada/US), with identical products on both sites. Customers will be signed up to one website or the other, depending on their region.

How can I have a single login page that, after the customer logs in, takes her/him to whichever website he/she is signed up to?

As a side note, I am using the extension http://www.magentocommerce.com/magento-connect/private-sales-5.html so that the store is only visible to logged in users.

Also, I understand that Customers can be scoped globally in System > Configuration > Customer Configuration > Account Sharing Options but currently I have them set to Per Website. Will this setting help me?


texts: Magento 1.8.1 updates customer "created_at" time on every save

texts:
I just installed a fresh copy of magento 1.8.1 (was having this same problem on my production site) and every time a user edits their account the "created_at" value is updated in the database. And it appears it's being updated without any consistency. I get "created_at" date values for times in the future and past.

Does anyone know a solution to this?

Edit: Actually my original question isn't really the main problem anymore. The problem is that the created_at time is wrong. I do not get the issue of it changing on save anymore (odd).

How to duplicate the issue:
1. Install a fresh copy of 1.8.1
2. Register a new customer on the frontend
3. Check the "Customer Since" date in the admin panel under manage customers.


texts: Get attribute from multiple attribute sets

texts:
I'm trying to select all products with an attribute called uitgelicht_product set to Ja. It's not the first time that I'm doing this and it usually goes well, but this is situation is a bit different, because I have 2 different attribute sets. The attribute occurs in both attribute sets: Default and Test.

I'm able to retrieve the products with uitgelicht_product set to Ja in the Default set, but I also want the products from the attribute set Test. I tried using this to see if I can get it only from Test:

$products->addAttributeToFilter('attribute_set_id','39');

But this doesn't return anything, while 39 is the attribute ID of Test. Changing 39 to 4 (the id of the Default set) works fine and returns the product using the attribute set Default with uitgelicht_product set to Ja.

How do I get the products with uitgelicht_product set to Ja in both the Test as the Default attribute set?

This is the entire code I'm using to retrieve the products:

<?php
$_helper = $this->helper('catalog/output');
$productBlock = $this->getLayout()->createBlock('catalog/product_price');

$yesOpID = null;
$attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'uitgelicht_product');
if ($attribute->usesSource()) {
    $options = $attribute->getSource()->getAllOptions(false);
    foreach ($options as $e) {
        if ($e['label'] == 'Ja'):
            $yesOpID = $e['value'];
        endif;
    }
}

$products = Mage::getModel('catalog/product')->getCollection();
$products->addAttributeToSelect('*');
$products->addAttributeToFilter('uitgelicht_product', $yesOpID);
$products->addAttributeToFilter('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
$products->addAttributeToFilter('attribute_set_id', '39');
$products->addStoreFilter();
$products->getSelect()->group('e.entity_id');
$products->getSelect()->order('RAND()');
$products->getSelect()->limit(4);


texts:
I understand that the built in "remember me" functionality of Magento persists the shopping cart.

However, I want it to also keep the customer logged in if they select "Remember me". How can this be accomplished?


texts: Timezone and locale dropdown in custom form frontend

texts:
I need to add these 2 dropdown to the custom frontend form.

Any help would be appreciate. Thank you!


texts: Magento 2 check if customer is logged in in admin area

texts:
I have the following code to see if a user is logged in. It sort of works as in it works within the customer area (user logged in) but doesn't work outside of the customer area even though the customer is still logged in.

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');
if($customerSession->isLoggedIn()) { ?>

    <a <?php /* @escapeNotVerified */ echo $block->getLinkAttributes() ?>><?php echo $block->escapeHtml($block->getLabel()) ?>

Hello World

?>
<?php
}
else {
?>

Not logged in

<?php
}
?>


texts: payment information depends on shipping information magento

texts:
Payment information depends on shipping method

In Shipping Method when selected Standard Shipping 2-7 days then hide Cash On Delivery and vise versa

when shipping method is fixed then hide check money order if check stranded shipping then hide cash on delivery

i already add this code in \app\design\frontend\base\default\template\checkout\onepage\payment\method.phtm

getMethods(); $oneMethod = count($methods)
__('No Payment Methods') ?>
getCode(); if($_POST['shipping_method'] == 'flatrate_flatrate') { if($_code == 'checkmo') { continue; } } ?>


texts:
I want copy a magento installation in hosting to update in localhost.

I copy all files to my localhost and y create database in my localhost. I import all in my database and I changed core_config_data in local database. But when I access to my url in local, It has an error. I copy error.log:

  [Thu Dec 29 09:26:09.559916 2016] [:error] [pid 13880] [client
  192.168.255.24:50420] PHP Fatal error:  Uncaught Error: Function name must be a string in
  /var/www/web/web/app/code/core/Mage/Core/Model/Layout.php:555\nStack
  trace:\n#0
  /var/www/web/web/app/code/core/Mage/Core/Controller/Varien/Action.php(390):
  Mage_Core_Model_Layout->getOutput()\n#1
  /var/www/web/web/app/code/core/Mage/Cms/Helper/Page.php(137):
  Mage_Core_Controller_Varien_Action->renderLayout()\n#2
  /var/www/web/web/app/code/core/Mage/Cms/Helper/Page.php(52):
  Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController),
  'buyshop_home')\n#3
  /var/www/web/web/app/code/core/Mage/Cms/controllers/IndexController.php(45):
  Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController),
  'buyshop_home')\n#4
  /var/www/web/web/app/code/core/Mage/Core/Controller/Varien/Action.php(419):
  Mage_Cms_IndexController->indexAction()\n#5
  /var/www/web/web/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254):
  Mage_Core_Controller_Varien_Action->dispatch('index')\n#6
  /var/www/web/web/app/code/core/Mage/Core/Controller/Varien/Front.php(176):
  Mage_Core_Controll in
  /var/www/web/web/app/code/core/Mage/Core/Model/Layout.php on line 555

I read in other pages that I have to change this file, but It the same that y have in the hosting, I think that If y copy the same, this should run good.

What I can do?

Thanks.!


texts: How to check the psr4 coding standard in magento2. from any tools

texts: I want some tools or Extension from which we can check coding stander of psr4


texts: change the color of Sunday days in the calendar (it is red and needs to be any other color)

texts:
I have a calendar and I want to do deliveries on Sunday but when I enabled Sunday in the Admin panel for the calendar - it lets people select Sunday but the day is in the RED color which discourages people from ordering on that day...I looked in the Look At Code thingy in Chrome and found this:

font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.42857143;
    **color: #960000;**
    background-color: #e1e1b6;

it points to myOWNdomain/index.php/checkout/onepage

How do I find out which file I need to change the color code in? Thank you so much for any help! :-*

I now think the color code should be f23f3f...I found this in main.css but changing it does not change anything...

I contacted the calendar people and this is what they replied:

The module is using calendar from Magento default
Please edit  /skin/frontend/base/default/css/bss/orderdeliverydate/calendar.css
Add:
.calendar thead .weekend{
 color: #000;
}
at the bottom of the file to change color of the text.

I did that but it did not help with the days being red (it just changed the color of the word SUN to black from red. I also put a space between weekend and { Please help...

This is the calendar.css file:

.calendar {
    border: 1px solid #CCC;
}

.calendar tbody .disabled {
    /*border:1px solid #DDD;*/
}

.calendar tbody .disabled {
    color:#666;
    opacity:0.5;
    background: #FCFCFC none repeat scroll 0% 0%;

}
.calendar table {
    background: #F5F5F5 none repeat scroll 0% 0%;
    border:none;
}

.calendar .button {
    border-color: #FFF #FFF #FFF #FFF;
}

.calendar thead .title {
    color:#666;
    background: #F5F5F5 none repeat scroll 0% 0%;
    border:none;
}

.calendar tfoot .ttip {
    color:#666;
    background: #F5F5F5 none repeat scroll 0% 0%;
    border:none;
}

.calendar thead .name {
    background: #F5F5F5 none repeat scroll 0% 0%;
    font-weight:bold;
    border:none;
}

.calendar thead .hilite {
    background: #E5E5E5 none repeat scroll 0% 0%;
    border-color: #FFF #DDD #DDD #FFF;
    border-width:2px;
    border-style:solid;
}

.calendar table .wn {
    border-right:1px solid #FFF;
    background-color: #F4F0E8 none repeat scroll 0% 0%;
}

.calendar td.time {
    border-top: 1px solid #FFF;
    background-color: #F5F5F5;
}

.calendar tbody .day {
    border:1px solid #FFF;
}

.calendar tbody td.selected {
    border-color: #FFF #BBB #BBB #FFF;

}

.calendar tbody td.hilite {
    border-color: #FFF #BBB #BBB #FFF;
    border-width:2px;
}
.calendar .nav {
    background:none;
    vertical-align:middle;
}

.bss-delivery-date #advice-required-entry-shipping_arrival_date_display {
    position:absolute;
    max-width:130px;
}

#shipping-method-buttons-container {
    margin-top:5px !important;
}

.calendar thead .calendar-title {
    border-color:#FFF;
    background: #F5F5F5 none repeat scroll 0% 0%;
    color: #666;
    border:none;
}

.calendar td.button {
    background-color:#F5F5F5;
    border:none;
    padding:3px;
}

.calendar td.button div {
    font-size:14px;
}

.calendar td.button div:first-child {
    font-size:13px;
}

.calendar table td.wn {
    border-left:1px solid #CCC;
}

.calendar thead .weekend {
 color: #000;
}


texts: How to execute php command clear cache from front end page in magento2

texts:
To add to denish's answer, you could write a little php script and place it into your magento root folder:

$command = 'php bin/magento cache:clean && php bin/magento cache:flush';
echo '<pre>' . shell_exec($command) . '</pre>';

This code place to which folder and what file in root directory, When I run my page in frontend : https://www.atomicgolf.shop/contact-list

How could I do for this?


texts: issue in upgrading phpseclib in magento2

texts:
I am working on a task that requires sftp connection and related functions. In magento phpseclib provide the same but they have not yet upgraded the library and it contains deprecated methods and constructors. I have downloaded the latest library and trying to use it with magento2.

What I have done is.. replaced the complete latest phpseclib with original phpseclib folders. But when I am trying to access the sftp class it keeps showing error that class SSH2 not found which is parent class for sftp.

I tried updating path n namespace but no luck.

Can anyone help me as I am stuck with this now.


texts: How to include custom JS to admin create new product in magento 2

texts:
I want to include custom JavaScript to create new product form.

I already try with below way

Using XML way.

  app/code/Namespace/Modulename/view/adminhtml/layout/index_index_add.xml

<head>
    <link src="Namespace_modulename::js/website_validation.js"/>
</head>

Using require-config.js way

  app/code/Namespace/Modulename/view/adminhtml/require-config.js

var config = {
   'paths': {
       websitevalidation: 'Namespace_Modulename/js/website_validation'
   }
};

  app/code/Namespace/Modulename/view/adminhtml/web/js/website_validation.js

require(['jquery','websitevalidation'],function($){
    $(window).load(function() {
        alert('innn');

    });
});

What i missing or wrong in above code.

Any help would be appreciated. Thanks.


texts: Magento 2 : How do i ONLY display the number currently in cart?

texts:
I am trying to display the number of items currently in my cart, however not getting any result. In magento 1 we just just add the following to our phtml file and it will just echo the no. of items in cart.

Mage::getModel(‘checkout/cart’)->getQuote()->getItemsCount();

This of course does not work in in magento 2 (version 2.0.2). Within my custom html file. I just need to  echo just the number, just like you get when get a number on the mini cart.
This is the section of code i need to put it in

Basket:
    ?????? item(s)

I need to put the number in replace of the question marks.
This may be a simple question, however i am still in the early stages of my learning curve, help is greatly appreciated. Thanks


texts: How to render HTML entities in the wishlist sidebar

texts:
I have added the © symbol to product names in Magento 2. These all appear fine on the category and product pages, however when I add an item to my wishlist the product name appears with the text & copy; rather than the actual © symbol in the wishlist sidebar widget. The same applies to the recently ordered sidebar widget. See below screenshot demonstrating this:

Does anyone know how we can convert these HTML entities to the correct symbol in the sidebar widgets?


texts: cybersource tokenization & magento communication

texts:
How cybersource tokenization works for recurring profile in magento?
where toekn is saved & how it is passed to cybersource for send time?

Any help.


texts: Upgrade from 1.9.2.3 to 1.9.3.1 Can not Upload Product Images in Admin

texts:
From what I understand, Magento removed the Flash uploader. When I upgraded I did an FTP merge. I have since Deleted the folder:  /skins/adminhtml/default/default/media/

I do not have CreareSEO module

In Admin section: /app/design/adminhtml/default/default/layout/main.xml the following line is there:

<action method="addJs"><script>mage/adminhtml/uploader.js</script></action>

app/design/adminhtml/default/default/layout/ these lines are in:

<action method="addJs"><name>lib/uploader/flow.min.js</name></action>
<action method="addJs"><name>lib/uploader/fusty-flow.js</name></action
<action method="addJs"><name>lib/uploader/fusty-flow-factory.js</action>

The only extension I can think of that would affect Admin would be Enhanced Admin Grids. In app/design/adminhtml/default/default/layout/bl/customgrid.xml
I added these:

<action method="addJs"><name>lib/uploader/flow.min.js</name></action>
<action method="addJs"><name>lib/uploader/fusty-flow.js</name></action>
<action method="addJs"><name>lib/uploader/fusty-flow-factory.js</action>

There are no new errors in the errorlog

I have tried a bunch of other things and poked around everywhere I can think of on the site and looked at every answer I could find online with Google.

Any help would be greatly appreciated. This is a major problem that I need to resolve now. We cannot add products to the site without image.


texts: Magento 2 - Event dispatched when user click “Proceed To Checkout”

texts:
What is the name of the event that is dispatched when a customer clicks on "Proceed To Checkout" after adding stuff to their cart? I want to register that a user started a checkout process for analytics. Specifically, I need to capture the contents of the cart and other information such as total price etc.

I've tried most of the events on this link that are related to either "checkout" or "cart". None of them seem to be dispatched when a user clicks "Proceed To Checkout". The nearest that I could get was

  controller_action_predispatch_checkout_cart_index

which is dispatched when a user clicks "View and Edit Cart".

I'm looking at a couple of ways to solve this.

Get the name of the event that is dispatched when a user clicks "Proceed To Checkout". Observe that event and "hook" my code to it.
Or is there a way to see all the events that are being dispatched in real time? I'm thinking that I might be able to find some other event that is dispatched near the same time as checkout and then observe that one.


texts: To remove block in product page in magento 2

texts:
I have created custom module for product review.If I click the review link, It shows the popup. In that it contains Default review form (But I have modified the form).In my layout file I have hided the review tab which is present in the product page in calalog_product_view.xml. But now, It shows following json error while loading the product page.

  Error

**Uncaught SyntaxError:** Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at run (layout.js:164)
    at app.js:14
    at main.js:31
    at Object.execCb (require.js:1650)
    at Module.check (require.js:866)
    at Module.<anonymous> (require.js:1113)
    at require.js:132
    at require.js:1156
    at each (require.js:57)
run @ layout.js:164
(anonymous) @ app.js:14
(anonymous) @ main.js:31
execCb @ require.js:1650
check @ require.js:866
(anonymous) @ require.js:1113
(anonymous) @ require.js:132
(anonymous) @ require.js:1156
each @ require.js:57
emit @ require.js:1155
check @ require.js:917
(anonymous) @ require.js:1113
(anonymous) @ require.js:132
(anonymous) @ require.js:1156
each @ require.js:57
emit @ require.js:1155
check @ require.js:917
enable @ require.js:1143
init @ require.js:774
(anonymous) @ require.js:991
(anonymous) @ require.js:132
(anonymous) @ mixins.js:106
execCb @ require.js:1650
check @ require.js:866
(anonymous) @ require.js:1113
(anonymous) @ require.js:132
(anonymous) @ require.js:1156
each @ require.js:57
emit @ require.js:1155
check @ require.js:917
enable @ require.js:1143
init @ require.js:774
callGetModule @ require.js:1170
completeLoad @ require.js:1544
onScriptLoad @ require.js:1671

Please provide the suggestion
My custom layout file

calalog_product_view.xml

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="reviews.tab" remove= "true"/>
        <referenceBlock name="product.info.review">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">XXX_YYYY::review.phtml</argument>
            </action>
            <block class="Magento\Framework\View\Element\Template" name="custom.review.popup" template="XXX_YYYY::popup.phtml">
                <block class="Magento\Review\Block\Form" name="custom.product.review.form" as="custom.review_form" template="XXX_YYYY::form.phtml"/>
            </block>
        </referenceBlock>
    </body>
</page>


texts: Why is there a DI preference for ProductInterface?

texts:
The ProductInterface has a DI preference leading it the ProductModel. While ProductModel is marked as falling under the Backward Compatibility Standard (it is marked with @api), it is still belonging to the Persistence Layer and not the Domain Layer, so hence it should not be used directly. At least, that's my understanding of the Persistence Layer. In other words, injecting ProductInterface in your class constructor is to be discouraged (and perhaps even prevented): Instead, you should be injecting ProductRepositoryInterface in your class constructor. And while using the repository, you might get your hands on ProductInterface anyway ($product = $productRepository->get(...)) - something that I would call "indirect injection" (I'm making up things as I write).

Here's the question: If the only usage of ProductInterface is triggered via other classes (a repository or perhaps a factory) and if injecting ProductInterface in the constructor should not be done, why is there a DI preference for it?


texts: create or remake a block with a rating of reviews

texts:
I have a block in the product description for the product page, I need to transfer it after the tabs and redo the styles

I moved the block to xml
<move element="product.info.review" destination="content"  after="product.info.details"/>

the block has moved below the tabs

I added styles and it turned out that in the picture

    .product.info.detailed {
      max-width: 55%;
      float: left;
    }

    .product-reviews-summary {
      float: left;
      border: 1px solid @product-heart-color;
      margin-left: 3%;
    }

but I need to create something like this, please help

ps_______________________________


texts: Magento 2: How to block or disable invoice email if payment method is "Invoice" or "Bank transfer"?

texts:
Magento 2 send order & invoice email manually
This may related but it doesn't solve my problem. Any ideas or specific approach?


texts: Fatal error: Class 'Magpleasure_Filesystem_Helper_Data' not found

texts:
I have this error also accross the banner in my admin page and cannot access admin section.  I was told by 1&1 my site was hacked about 2 weeks ago, I have not added any modules or touched site in some time so I didn't cause issue.

I would like to know how to get rid of this problem though?  Someone mentioned there was a patch to install. If I cannot access back end, how do I edit anything?
I can edit mage.php file, but I am not a programmer so can someone please advise what I need to do?

Steven


texts:
I have install Magento 2.3.0 in php 7.2 xampp windows 7. After installing i have run following command

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f

When i open admin, i am getting blank screen. no javascript error. On frontend i am getting following error in console

"NetworkError: 404 Not Found - http://localhost/magento-230/mage/translate-inline.js"
transla...line.js
Error: Script error for: mage/translate-inline
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 166, col 17)
"NetworkError: 404 Not Found - http://localhost/magento-230/mage/dataPost.js"
dataPost.js
"NetworkError: 404 Not Found - http://localhost/magento-230/mage/bootstrap.js"
bootstrap.js
Error: Script error for: mage/dataPost
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 166, col 17)
Error: Script error for: mage/bootstrap
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 166, col 17)
"NetworkError: 404 Not Found - http://localhost/magento-230/jquery.js"
jquery.js
"NetworkError: 404 Not Found - http://localhost/magento-230/jquery/jquery.mobile.custom.js"
jquery....stom.js
Error: Script error for: jquery
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 166, col 17)
Error: Script error for: jquery/jquery.mobile.custom
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 166, col 17)
"NetworkError: 404 Not Found - http://localhost/magento-230/Magento_Theme/js/responsive.js"
responsive.js
Error: Script error for: Magento_Theme/js/responsive
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 166, col 17)
"NetworkError: 404 Not Found - http://localhost/magento-230/Magento_Theme/js/theme.js"
theme.js
Error: Script error for: Magento_Theme/js/theme
http://requirejs.org/docs/errors.html#scripterror

var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

Can anyone help me how to fix this error and how magento 2.3.0 work properly in my pc.


texts:
need to hide description on specific parent category and all child category.

like

test = parent
abc1 = child category
abc2
abc3 and more 70+

i want hide description on test category and all sub category on list page.


texts: New orders not being shown on user dashboard

texts:
Suddenly, new orders are not being shown in the user dashboard anymore, under "My orders" section. Altough, those orders are being registered in the admin panel.

Magento Version 1.8.1.


texts: Magento 2 - How to do get the product attribute code and value associated with product using product id?

texts:
Hi i want to show the products attribute code and it's value using the product id.

How can i do this? Any help would be appreciated.


texts: Installed Magento 2, tried to go to the Magento Frontend/Admin in Chrome, but only get "This site can’t be reached"

texts:
I have been trying to fix this since yesterday without any seeming success or even progress, so I hope someone out there can figure it out and help me.

I have installed Magento 2 using the Ubuntu console, on a pc running windows 10.

  I followed this guide
  (https://websiteforstudents.com/install-magento-2-using-composer-on-ubuntu-16-04-18-04-with-apache2-mariadb-and-php-7-1-support/)
  but at step 8 (the last step) I restarted apache2 and found that the
  Magento Frontend and Admin weren't accessible for some reason.

  I tried entering both localhost/magento2 and jjsmykker.dk into the
  Chrome address bar, magento2 being the ServerName and
  http://jjsmykker.dk/ being the ServerAlias in the magento2.conf,
  but all attempts ended in the same error being shown in Chrome (as
  well as the other browsers I've tried it in).

Below I've included an image of the error Chrome is throwing at me, as well as an image of the magento2.conf file.

I'm a beginner at both Magento and at using the Ubuntu Console, so I hope you'll bear with me, and that someone here can help me out and get me moving forward after being stuck with this for far too long!

  EDIT 1:

  I ran these commands as it was suggested in an answer here. It didn't
  change the error message on Chrome, but I've added this image to show
  an apache2 warning that according to my research shouldn't impact this
  situation, but as I'm new at this I've included it just in case I'm
  wrong.


texts: Magento 2 restrict cache clean on product save action

texts:
I have written a Inventory update module which will save product inventory by reading CSV file provided.

Every thing is working fine but this impacting the site performance. If I am updating 100+ products then for every single product magento is clearing cache, in beforeSave() method.
In class Magento\Catalog\Model\Product we have beforeSave() method, which is calling

$this->cleanCache();

in the first line.
Please suggest me.

How can I restrict this cache or remove this from beforeSave() method?
And from where this beforeSave() method is called on product save?


texts: One shopping cart price rule for one time use by a single customer only

texts:
I want to make a shopping cart price rule which can be used only once by a single customer/user only after then that coupon can not be used by the same user.

I am new to magento and have to implement this in my project and did a lot of research for this but could not find any solution.

I also want to know how to make the coupon to be used by all the group of users i.e. Not Logged In, General, Wholesale, Retailer.

Basically, the coupon should be used once only by one customer/user.

If anyone has done this then please help me.

I am using Magento community 1.9.1.0.


texts:
I am getting Connection to 79.951.791.91 closed by remote host error while migrating from Magento 1 to Magento 2.
What is the solution ?


texts:
I have a static block for my main menu. I am unable to make this block working. I need to change the URL for my site main menu, but since this block doesn't work. I am not able to figure out how to do it. Even after deactivating the block, it still shows the main menu, which somewhat means that this block always remains activated.

Here's the code for the static block

about us

contact us

blog

Block Title: Menu Links
Identifier: pt_menu_links

This is the website : singhcycle.com
I need to update the link of the main menu (About Us, Contact Us, Blog)


texts: Display real time discount price everywhere

texts:
I have a store with different customer group.in which all customer has a specific discount for all product.Suppose customer group A has 10 customer and discount is also 10% on all product.
Discount is decided from one of  my API site  so it's a real time discount for different customer group
When customer logging in that belongs to customer group A he/she is able to see price with 10% discount every where (Product listing,product view,and with whole check out process.)

i can achieve this by calling below code but it display only on cart page not every where.

checkout_cart_product_add_after

observer function

$item = $observer->getQuoteItem();
     $product = $observer->getProduct();
     $price = $product->getPrice();
     //print_r($item->toArray());exit;
     // Discounted 25% off
     $percentDiscount = 0.25;

     // This makes sure the discount isn't applied over and over when refreshing
     $specialPrice = $product->getPrice() - ($product->getPrice() * $percentDiscount);
     // Make sure we don't have a negative
     if($specialPrice>0){
        $item->setCustomPrice($specialPrice);
        $item->setOriginalCustomPrice($specialPrice);
        $item->getProduct()->setIsSuperMode(true);
        }

How can i achieve this Please help


texts: Multiple select product attribute is not showing in front end

texts: I have created a product attribute(Bookcase Doors) and selected it has multiple select and in advanced attribute properties I have made the scope as Global but I am not getting this attribute at a front end.


texts: Web api testing could not use ApiSuiteLoader

texts:
I am new to testing in Magento. To add a new functional api test, I followed https://www.youtube.com/watch?v=JAA7BkH82gY&ab_channel=MaxPronko but he doesn't show how he runs the test.
I followed the instructions of Magento and ran this command:

vendor/bin/phpunit --config ./dev/tests/api-functional/phpunit_rest.xml

But I get this error. And I dont't know how to fix it

PHPUnit 9.1.5 by Sebastian Bergmann and contributors.
Could not use "Magento\TestFramework\ApiSuiteLoader" as loader.
=== Memory Usage System Stats === Memory usage (OS):  56.30M (201.07% of 28.00M reported by PHP) Estimated memory leak:   28.30M (50.27% of
used memory)

How can I solve this problem? or is there another solution to run the web api functional tests?


texts: Run multiple cron groups but not all in magento 2

texts:
I wanted to run the following way.

php bin/magento cron:run --group="test_group1","test_group2","test_group3"

OR

php bin/magento cron:run --group="test_group1,test_group2,test_group3"

What is the valid command for this?
If not possible though command, what is the best way?


texts: How to change products in hot sellers list Luma theme (RESOLVED)

texts:
I found code hot sellers widget in cms block,

  {{widget type="Magento\CatalogWidget\Block\Product\ProductsList" products_per_page="5" products_count="5" template="product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Combine;s:10:aggregator;s:3:all;s:5:value;s:1:1;s:9:new_child;s:0:``;]s:4:1--1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Product;s:9:attribute;s:3:sku;s:8:operator;s:2:();s:5:value;s:60:WS12, WT09, MT07, MH07, 24-MB02, 24-WB04, 241-MB08, 240-LV05;]]"}}

But i got error when replace a product have sku WS12 by WSH12.

  {{widget type="Magento\CatalogWidget\Block\Product\ProductsList" products_per_page="5" products_count="5" template="product/widget/content/grid.phtml" conditions_encoded="a:2:[i:1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Combine;s:10:aggregator;s:3:all;s:5:value;s:1:1;s:9:new_child;s:0:``;]s:4:1--1;a:4:[s:4:type;s:50:Magento|CatalogWidget|Model|Rule|Condition|Product;s:9:attribute;s:3:sku;s:8:operator;s:2:();s:5:value;s:60:WSH12, WT09, MT07, MH07, 24-MB02, 24-WB04, 241-MB08, 240-LV05;]]"}}

Error filtering template: Notice: unserialize(): Error at offset magento widget

I don't know how to add or replace products in widget right way.

Update

After struggle with this issue i resolved it by my self. I wrote script create conditions_encode by using class Magento\Widget\Helper\Conditions; It has encode function.

Using encode value and replace conditions_encoded products will update.

<?php

use Magento\Framework\App\Bootstrap;
use Magento\Widget\Helper\Conditions;
require __DIR__ . '/app/bootstrap.php';

$bootstrap = Bootstrap::create(BP, $_SERVER);

$obj = $bootstrap->getObjectManager();

$state = $obj->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
$cons= array(
    "1"=>array(
        "type"=>'Magento\CatalogWidget\Model\Rule\Condition\Combine',
        "aggregator"=>'all',
        "value"=>'1',
        "new_child"=>'',
    ),
    "1--1"=>array(
        'type'=>'Magento\CatalogWidget\Model\Rule\Condition\Product',
        'attribute'=>'sku',
        'operator'=>'()',
        'value'=>'crowe-sweater,Easy Full Dress,Herve Leger,Striped Maxi Dress,Daisy Lace Trim Blouse',
    )
);
$a=new Conditions();
$s=$a->encode($cons);
echo "<pre>";
echo($s);
echo "</pre>";exit;


texts: What is the best way to update multiple product prices by a percentage?

texts:
We have several thousand products in our Magento store and every January we like to do a price increase of around 2-3%.
In the past we have exported the products and manually edited the prices in the sheet and then uploaded the sheet.
Is there a quicker way to do this?


texts: How can i restrict Cross-site Attacks? Even All Patches are Installed

texts: I am Using magento 1.9.1.0. Now I was Scanned My website by third party scanning . Now i seen the Cross Site Script on my website, How can i restrict the Cross site Scripting in my site. Please Help me.


texts: how to use the store url for link in checkoutpage?

texts: On the checkout page (onepagecheckout) i have included the t&c link. In the contents i included a link to the t&c page like this: algemene voorwaarden but i does not work... it sends me to: http://dev.blinckstar.nl/checkout/onepage/%7B%7Bstore%20url= ... what am i doing wrong?


texts: Have any way to change cancel url in paypal payment? (Magento Heidelpaycd edition)

texts:
I am using module Magento Heidelpaycd edition.
Have any way to change this message to "cancel and return to my site".
Look at picture.

Thanks


texts: How can I modify the price with a formula?

texts:
I use this function to modify the price display on homepage. But I don't know how to get the value of attributes. Any ideas on the best way to do this? Thanks so much!

public function collectionFinalPrice($observer) {
    $collection = $observer->getEvent()->getCollection();
    foreach($collection as $_product){
    // $per = ???
    // $amount = ???
    $finalPrice = (1000+$amount)*$per;
    $_product->setMinimalPrice($finalPrice)
              ->setPrice($finalPrice)
              ->setFinalPrice($finalPrice);
    }
    return $this;
}


texts: Creating an exposed endpoint URL for service returns in Magento 2

texts:
I'm writing an extension that utilizes web services and I need a way for those web services to send information back to the extension over the internet.

Would I just use a controller like every other action? The URL would have to be fully public (no admin key in URL). Or would I trigger an event via an observer. I couldn't find an observer event that waits for the callback URL to be hit.

So far I've tried creating a folder with a file inside (myCompany/myModule/Notify/Notifications.php).

<?php
//Notifications.php
namespace myCompany\myModule\Notify;

class Notifications
{
    /**
    * Constructor
    */
    public function __construct(
        \myCompany\myModule\Api\Data\EntityInterface $entityModel
    ) {
        file_put_contents('/home/username/Desktop/test/log.txt', 'endpoint' . "\n", FILE_APPEND);
        $this->_entityModel = $entityModel;
    }
}

Then I tried going to http://myMagento.com/myCompany/myModule/notify/notifications.php and my test doesn't print out.

As an example, here's how it's done in Drupal 8.

myCompany.notify:
  path: '/myCompany/notify'
  defaults:
    _controller: '\Drupal\myCompany\Controller\NotificationController::endpoint'
    _title: 'Notification Receiver'
  requirements:
    _access: 'TRUE'


texts:
I have imported some products and later needed to change the URL keys so I have prepared a CSV which contain SKUs and the new url keys (ie: sku,url_key) . But after successfully import (Update existing items only,skip new ones) and check with backend product URL keys but they are not changed , I have re index them all but still the same, then I have imported the same CSV file using advanced dataflow profiles and it is working fine URL keys changed as per the CSV by using dataflow profiles . So can someone explain me why this is happening ?

regards
chamal


texts:
Developer view, please

app/code/YourCompany/YourModule/etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<!-- <preference for="Magento\Catalog\Block\Product\View" type="Amf\GoogleAnalytics\Block\Catalog\Product\View" /> -->
<preference for="Magento\GoogleAnalytics\Block\Ga" type="YourCompany\YourModule\Block\Ga" />

Please let me know the best way

copy files from vendor\magento\module-google-analytics\Block\Ga.php then modify the method.
vendor\magento\module-google-analytics\Block\Ga.php - copy only required the method then do the modification.(code - https://textuploader.com/1a8x4)

Following point 1 error appears

Fatal error: Uncaught TypeError: Argument 4 passed to Magento\GoogleAnalytics\Block\Ga::__construct() must be of the type array, null given, called in app\code\YourCompany\YourModule\Block\Ga.php on line 57 and defined in vendor\magento\module-google-analytics\Block\Ga.php on line 45

Following point 2 block override done - just override method getOrdersTrackingCode() and getOrdersTrackingData

The solution for the issue mentioned here


texts: I excidently upgraded the magento version from 2.2.0 to 2.2.1 through composer. Is there a proper way to downgrade back to 2.2.0? I have a database backup of magento 2.2.0.


texts: Wrong Tax calculation when creating order from Admin

texts:
I have an issue I can't solve from normal TAX panel.

I have all my shipping prices setted without tax in the admin and they are  calculated in the right way in the cart and checkout page in frontend. Please see image

As you can see from the picture the shipping cost is 8.20 + 22% tax and is correctly showed as 10 €.
Shipping Tax  are also well included in Tax (Tasse) row.

Now the issue I have is that if i create an order from the admin using the same customer/address/product/shipping method, the Shphipping and Handleing are wrong!! They are without tax (also if shipping method shows them including tax)
See the image below

If I click 2 times on the Radio Button of the shipping method, the Shipping and Handling value it gets right.
So once I click for a second time on the choosen shipping method radio button I get the right value of 10€ (instead of the wrong 8.20€) just as on the front page(see first image).

So it looks like Magento doen't add tax on the first click, then on the second it does.

Is that a bug of Magento 1.8 ?  How can i overwright the tax calculation for the admin block?


texts: Issue with shopping cart rule. Please help

texts: I am having an issue with a shopping cart price rule. I am basically giving customers free shipping for certain products and paid shipping for other products. The rule is working fine when you have a single product in the cart, but when you add a free shipping product with a paid shipping product, shipping is showing as free instead of being charged the shipping for the other product. Attached is a screenshot of my settings. Thanks!


texts:
I am trying to get all the orders for the specific product by that product_id, and customers that have bought that product. The query at the moment is not working as it should - this is getting all orders. If I put $productId to be non-existing product there is no result, but if I put real product I am getting all the orders.
Code:

require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

$productId = 297;

$orders = Mage::getModel('sales/order')->getCollection();
$orders
     ->getSelect()
     ->joinInner(array('order_item' => Mage::getSingleton('core/resource')->getTableName('sales/order_item'), 'order_item.order_id = main_table.entity_id' ))
     ->where('product_id=?', $productId)
     ->group('main_table.entity_id')
     ->order('main_table.entity_id DESC');

$header = 'date,company,name,city,address,postcode,itemname,quantity,price,sku';
$fields = '';
foreach($orders as $order):

     //$order->getData();
     $order->getIncrementId();
     $billingAddress = $order->getBillingAddress();
     $shippingAddress = $order->getShippingAddress();
     $billingStreet = $billingAddress->getStreet();
     $fields .=
          date('Y-m-d',strtotime($order->getCreatedAt())).','.
          $billingAddress->getCompany().','.
          $billingAddress->getName().','.
          $billingAddress->getCity().','.
          $billingStreet[0].','.
          $billingAddress->getPostcode().','.
          $order->getShippingDescription() .',';

          foreach ($order->getAllItems() as $itemId => $item):
               $itemname =  $item->getName();
               $itemname =  str_replace('&', " ", $itemname);
               $fields .=
                    $itemname. ','.
                    $item->getQtyOrdered().','.
                    $item->getPrice().','.
                    $item->getSku().',';

          endforeach;
     $fields = rtrim($fields, ',');
     $fields .= "\n";

endforeach;
print "$header\n$fields";


texts: Magento 2 - How to set chown and chmod for root folder and sub folder in linux (centos 6.5)

texts:
In Magento 2,  How to set chown and chmod for root folder and sub folder in linux.
My OS system is the CentOS 6.5.
please, guide me step by step.

P/S: When use this command "find ./var -type d -exec chmod 777 {} \;" is this security ?


texts: Magento sending data from controller to view

texts:
I am passing data from magento controller to view but my theme is not showing the content in the view is displayed in a white page
here is my code

$block = $this->getLayout()->createBlock('core/template')
->setData('products_notavailable',$Not_available_products)
->setData('products_available',$available_products)
->setData('quantity',$submit_qty)
->setTemplate('availableorders/display.phtml');
$this->renderLayout();
$this->getResponse()->setBody($block->toHtml());


texts: Magento 1.x How to get order Total amount in my custom module page?

texts: How to get order total amount in my custom file ?


texts: Unwanted symbol in entry field with Onepage Checkout

texts:
Got another strange problem, whenever the checkout page is called the postcode field is immediately populated with a single '*'.

Tried several workarounds including using jQuery to try and strip it out but nothing seems to work.

Further information found, only occurs with guest checkout, seems to be a bizarre default somewhere. As well as this, as far as we can tell the issue started occurring after setting our region to require postcode (Unfortunately does not revert with the setting.)

Does anyone have any idea which file this might be occurring in?


texts: Magento 2 Braintree declined orders not sending Payment Failed emails

texts:
I'm using Braintree as default payment method for my Magento 2.2.3 store.

Sometimes, It happens that customer cannot finish checkout as his CC gets declined, when this happens I would like to get notified on email with information like what customer experienced this problem, what did he have in cart and what was order total.

As far as I understand, Magento 2 has this feature built-in but looks like it's not working properly with Braintree payment method. How could I fix this? I see that function sendPaymentFailedEmail is called from module checkout controller named SaveOrder.php in case of 2 errors (in 2 catch blocks), but it does not seem that Braintree error ever gets there.


texts: Export sessions data from files to REDIS

texts:
We are moving from single server to multiple server setup for our store. The problem is that we are using file cache type and we want to preserve those sessions (long expiration, per management request when we move to Redis server (by AWS).

Is there a way to export those sessions information from files to Redis?

Thank you


texts: How to define the order status after creating an shipping?

texts:
I have searched a lot with google but somehow I'm using the wrong search terms or there is no answer to my specific problem yet.

In Magento I'd like to have the following procedure: Customer creates an order, I generate an invoice (Status switches to processing) which is fine. I create shipment against the order ( Status swiches to Complete) I don't want it to switch to complete, so I created a - New Status ( Cust_ Confirmation ) Now the order stays in Cust_Confirmation State. How do it mark it complete?
This is what i want: Pending-->Processing-->Cust_ Confirmation-->Complete
I am stuck now between Cust_Confirmation & Complete


texts: Is there a Magento Extension that handles redirects?

texts:
I am coming from a Joomla CMS which has a built-in "Redirect Manager" (https://docs.joomla.org/Help36:Components_Redirect_Manager) component(extension) that will write to the .htaccess for me. It also will log 404 errors in the Admin panel of "Redirect Manager" and from that log I can create new redirects.

Does Magento have a built in Redirect Manager that is similar or paid extension from the extension site?


texts: How can I display all anchor categories even with no result (empty category)?

texts:
How can I display all anchor categories in Magento (1.9.0.1) even with no result (empty category) as for attribute product?

As default behavior when I set "anchor" a category, this is shown in "Shopping by" section only if is no empty. I'ld like to show all categories.


texts: Custom button to set custom order status

texts:
I created a custom module to add a button to the order view page.

The button shows up and now it is time to create the action attached. When clicking the button I want 2 things to happen:

Set the order status to: Ready for Pickup (pickup_ready) which I defined in order statusses
Send a transactional email to the client to inform them it is ready

My button looks like this for now:

{
public function  __construct() {

    parent::__construct();

        $this->_addButton('inform_pickup', array(
            'label'     => Mage::helper('sales')->__('Custom Pickup Button'),
            'onclick'   => 'setLocation(\'' . $this->getPickupUrl() . '\')',
        ));
    }

public function getPickupUrl()
{
    Not a clue what to put here......;
}
}

Any help is appreciated


texts: Pre populate the discount code in checkout/cart

texts:
I want to know if we can pre populate the discount code in the checkout/cart page when customer clicks a button from a page.

Aim is when customer clicks a button from a page it should redirect them to checkout/cart with the product in cart (could grab it from the session) but I want to apply a discount code at same time

Is this possible


texts:
I repare the error of CSS in frontend and backend, but the problem is that I use a theme in home page and it's load perfectly:

but in Held category I use custom theme and not load CSS:

Why?

I see that when I use setup:upgrade, frontend and backend not load css

Thanks.


texts: How can I set custom price in Checkout API

texts:
Is there a way I can apply a custom price in checkout cart using APIv2?

$product = array();
$product['sku'] = 'test'
$product['qty'] = 5;
// $product['price'] = 15;
$client->shoppingCartProductAdd($session, $cart, array($product));


texts:
I have created a cronjob in:

app/code/Vendor/Module/Cron/MyCron.php

It's in development phase, so every time I need to check the data or debug anything I am creating a log file and rescheduling it to run cron.

My question is, is there any way to run cron from browser? so that I can test it instantly.

Thanks in advance.


texts: How to get customer details in checkout_onepage_controller_success_action observer

texts:
I am creating an observer where I want to change group id of customer after placing an order.

I am getting this error:

  Fatal error: Call to a member function getCustomerId() on null in
  C:\xampp\htdocs\Magento2\app\code\Vendor\MyModule\Observer\ChangeCustomerGroupAfterOrder.php
  on line 30

events.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

    <event name="checkout_onepage_controller_success_action">
        <observer name="persistence_one" instance="Vendor\MyModule\Observer\ChangeCustomerGroupAfterOrder"  />
    </event>
</config>

Here is my observer/ChangeCustomerGroupAfterOrder.php

<?php

namespace Vendor\MyModule\Observer;

use Magento\Framework\Event\ObserverInterface;

class ChangeCustomerGroupAfterOrder implements ObserverInterface
{
    const CUSTOMER_GROUP_ID = 1;
    protected $_logger;
    protected $customer;
    protected $_customerRepositoryInterface;

    public function __construct(
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
         \Magento\Customer\Model\Customer $customer,
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->_customerRepositoryInterface = $customerRepositoryInterface;
        $this->logger = $logger;
        $this->customer =$customer;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $order = $observer->getEvent()->getOrder();
        foreach ($order->getAllItems() as $item) {

        }
        $customerId = $order->getCustomerId();
        $customers = $this->customer->load($customerId);
        $name = $customers->getName(); //customer name
        $groupid = $customers->getGroupId();
        $this->_logger->addDebug(' Customer ID: ' . $customerId . ', Customer Name: ' . $name . ', GroupId:' . $groupid);

        $this->logger->debug(' SUPRIYA AfterOrder Observer Is called!' . $customers->getFirstname());
        if ($customers->getGroupId() == 7) {
            $customers->setGroupId(self::CUSTOMER_GROUP_ID);
            $this->_customerRepositoryInterface->save($customers);
        }
    }
}


texts: Selecting Data form a table when attribute Id is 1105?

texts:
I am trying to display a customer reference on the sales order grid which i have created as a custom attribute on the sales order grid. I added this to _prepareColumns() to create the column

    $this->addColumn('accref', array(
        'header' => Mage::helper('sales')->__('Account Reference'),
        'index' => 'value',
    ));

And then this in _prepareCollection to try and retrieve the data

$collection->getSelect()->join('customer_entity_varchar', 'main_table.entity_id = customer_entity_varchar.value_id', array('value'));

The attribute is stored within customer_entity_varchar and the data I need is from the column "value" with an attribute ID of 1105 however it is returning everything in the value column

How can i change this code so it only selects the Value when the attribute ID is 1105??


texts: How to add save and continue button in ui-form in Magento 2?

texts:
I have created admin grid and form using ui component.
Now I need to add save and continue button, How do I add it?
Please provide me a solution


texts: White screen on admin login or other backend pages

texts:
I just grabbed the more reoccurring error log that keep popping up. (I tried posting al 4, but it kept saying it was spam and I couldn't post.) Not sure what the issue is, but it was working well. It started not showing up. White screen on login, or other pages on the back end. Any help would be much appreciated.

{"0":"Notice: Trying to access array offset on value of type null in \/home\/aronfiel\/public_html\/magento2\/vendor\/magento\/framework\/App\/AreaList.php on line 75","1":"<pre>#1 Magento\\Framework\\App\\AreaList->getCodeByFrontName() called at [vendor\/magento\/framework\/App\/Http.php:132]\n#2 Magento\\Framework\\App\\Http->launch() called at [generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php:24]\n#3 Magento\\Framework\\App\\Http\\Interceptor->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:261]\n#4 Magento\\Framework\\App\\Bootstrap->run() called at [index.php:39]\n<\/pre>","url":"\/magento2\/customer\/section\/load\/?sections=customer%2Ccompare-products%2Clast-ordered-items%2Ccart%2Cdirectory-data%2Ccaptcha%2Cinstant-purchase%2Cpersistent%2Creview%2Cwishlist%2Crecently_viewed_product%2Crecently_compared_product%2Cproduct_data_storage%2Cpaypal-billing-agreement%2Ccheckout-fields%2Ccollection-point-result%2Cpickup-location-result&force_new_section_timestamp=false&_=1608159578113","script_name":"\/magento2\/index.php"}


texts: remove the sub categories list from the category product listing page

texts:
I have done the product listing customization. But when click the category link, i got an subcategories listing page with product listing. I dont want to display the subcategories list when category has the products list.

example I have those category here.http://testbase.info/c/collectivecraft/WebSite/index.php/collections.html

Now when click on any category, you can see the category's product listing page with the sub category list. I do not want display the subcategory here.

How can it possible ? please help.


texts:
I am creating a multistore magento site. In my store switcher(NOT store-view) stores are listed by name as default. But for me its important to be listed by core_store_group_id from smaller to bigger.
How can i sort it in my store swithcher phtml
Thanks in advance


texts: How to display Product Name in the subject of the Email(Order Confirmation Email)?

texts:
I want to display product name in the subject of the Order confirmation email.
I want to display like this
Your Order for LooMantha Refrigerator... has been successfully placed


texts: Image of product is not coming in cart.info method of soap api

texts:
I need to show small image of product on cart page.Cart info is not giving any information for image of product.
So I have tried overriding cart.info method.

My config.xml(/etc/config.xml) is like:

 <?xml version="1.0"?>
 <config>
<modules>
    <Customsoapcart_Checkoutsoap>
        <version>0.1.0</version>
    </Customsoapcart_Checkoutsoap>
</modules>
<global>
    <models>
        <customsoapcart_checkoutsoap>
            <class>Customsoapcart_Checkoutsoap_Model</class>
        </customsoapcart_checkoutsoap>
        <checkout>
            <rewrite>
                <cart_product_api_v2>Customsoapcart_Checkoutsoap_Model_Checkout_Cart_Product_Api_V2</cart_product_api_v2>
            </rewrite>
        </checkout>
    </models>
    <helpers>
        <customsoapcart_checkoutsoap>
            <class>Customsoapcart_Checkoutsoap_Helper</class>
        </customsoapcart_checkoutsoap>
    </helpers>
</global>
</config>

My wsdl.xml(/etc/wsdl.xml) is like:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:typens="urn:{{var wsdl.name}}" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
         xmlns="http://schemas.xmlsoap.org/wsdl/"
         name="{{var wsdl.name}}" targetNamespace="urn:{{var wsdl.name}}">
<types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:Magento">
        <import namespace="http://schemas.xmlsoap.org/soap/encoding/"
    schemaLocation="http://schemas.xmlsoap.org/soap/encoding/"/>
        <complexType name="shoppingCartProductEntity">
            <all>
                <element name="small_image" type="xsd:string" minOccurs="0"/>
            </all>
        </complexType>

    </schema>
</types>
</definitions>

My V2.php file
(/namespacename/modulename/Model/Checkout/Cart/Product/Api/V2.php) is like:

<?php
class Customsoapcart_Checkoutsoap_Model_Checkout_Cart_Product_Api_V2 extends Mage_Checkout_Model_Cart_Product_Api_V2
{
/**
* Retrieve full order information
*
* @param string $orderIncrementId
*
* @return array
*/

public function items($quoteId, $store = null)
{
$productsResult = parent::items($quoteId, $store = null);
$productsResult['image']='image';
    return $productsResult;
}
}

Now when I call my web service in my script:

 $proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl', array('trace' => 1, 'cache_wsdl' => 0)); // TODO : change url
$sessionId = $proxy->login('username', 'apikey'); // TODO : change login and pwd if necessary

$result = $proxy->shoppingCartInfo($sessionId, '320');
echo '<pre>';print_r($result);

I am not getting extra field image in the result.
I think something is wrong with wsdl.xml which I am missing something in wsdl.xml but cant able to figure out it.


texts: magento 1.9.2.4 cron job Unable to load dynamic library mcrypt.so

texts:
The Magento cron job is throwing error.

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0

the file is not there do to cpanel compiling it into apache. Any help would be appreciated I have no idea how to resolve this.

Apache 2.2
PHP 5.5


texts: Paypal Pro: Merchant Country not supported errror

texts:
Suddenly from past few days, I am receiving this error when I am trying to do checkout with my credit card. I am using Paypal Payment Pro in magento.

"PayPal gateway has rejected request. The merchant country is not supported (#10565: Merchant country unsupported)."
Below is the log for the transaction Which I have processed.

2019-09-19T18:56:20+00:00 DEBUG (7): Array
(
    [url] => https://api-3t.paypal.com/nvp
    [DoDirectPayment] => Array
        (
            [PAYMENTACTION] => Sale
            [IPADDRESS] => 103.83.147.197
            [RETURNFMFDETAILS] => 1
            [AMT] => 0.50
            [CURRENCYCODE] => USD
            [INVNUM] => 100005331
            [NOTIFYURL] => https://jworldstore.com/index.php/paypal/ipn/
            [EMAIL] => steve****03@gmail.com
            [CREDITCARDTYPE] => ****
            [ACCT] => ****
            [EXPDATE] => ****
            [CVV2] => ****
            [ISSUENUMBER] =>
            [ITEMAMT] => 0.50
            [TAXAMT] => 0.00
            [SHIPPINGAMT] => 0.00
            [L_NUMBER0] => 38137435769
            [L_NAME0] => Testing only Product
            [L_QTY0] => 1
            [L_AMT0] => 0.50
            [BUSINESS] =>
            [FIRSTNAME] => steve
            [LASTNAME] => choi
            [MIDDLENAME] =>
            [SALUTATION] =>
            [SUFFIX] =>
            [COUNTRYCODE] => US
            [STATE] => NY
            [CITY] => flushing
            [STREET] => **** **** street
            [ZIP] => 11354
            [PHONENUM] => *********
            [SHIPTOCOUNTRYCODE] => US
            [SHIPTOSTATE] => NY
            [SHIPTOCITY] => flushing
            [SHIPTOSTREET] => **** *** street
            [SHIPTOZIP] => 11354
            [SHIPTOPHONENUM] => **********
            [SHIPTOSTREET2] =>
            [STREET2] =>
            [SHIPTONAME] => steve choi
            [METHOD] => DoDirectPayment
            [VERSION] => 72.0
            [USER] => ****
            [PWD] => ****
            [SIGNATURE] => ****
            [BUTTONSOURCE] => Magento_Cart_Community
        )

    [response] => Array
        (
            [TIMESTAMP] => 2019-09-19T18:56:20Z
            [CORRELATIONID] => 5b626bd47aa23
            [ACK] => Failure
            [VERSION] => 72.0
            [BUILD] => 53530896
            [L_ERRORCODE0] => 10565
            [L_SHORTMESSAGE0] => Merchant country unsupported.
            [L_LONGMESSAGE0] => The merchant country is not supported.
            [L_SEVERITYCODE0] => Error
            [AMT] => 0.50
            [CURRENCYCODE] => USD
        )

    [__pid] => 19820
)

As I have checked I found that this error is due to Paypal pro is only available in US And Canada. But as you can see the paypal log. My country is US. Also my Paypal business account is of US. Still I am getting this error. I have contacted Paypal support they said their is no issue from Paypal side. My magento version is 1.9.3.0

Can anyone please help me?


texts:
Magento 2 I have quote data but order not created transaction completed all done but order not created.So I am trying to create order by using quote data.

Can we convert quote data to order by loading quote id.For all order it is paypal payment?

Can any one tell me better process.


texts: How to show the tick mark after clicking the popup button in Jquery?

texts:
In checkout, we have enabled the "Terms and conditions" pop up and my requirement is to show the tick mark after closing the pop-up but right now it is happening only when we click the checkbox.
Please give me suggestions to make this work.
Code for Terms and condition:

    <input type="checkbox" class="required-entry">

        <button type="button" class="action action-show">
            I agree the Terms Conditions
        </button>

Code for Footer:

    <button class="action-close" data-role="closeBtn" type="button">
        Close
    </button>

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

    <button class="action secondary action-hide-popup" type="button" ">Close</button>


texts: Is there a way(s) to keep developer credentials in Magento project hidden?

texts:
I'd like to store developer credentials (like name, email or something like that) inside Magento site, unlike putting (c) developer in footer , but somewhat hidden somewhere. only person who put that/developer can know there is that information stored. Also it should be able to be displayed when needed to.

Is there any way/ways someone can do this?


texts:
How to get the gift message value in Magento2.1.7?

I am getting the gift message value as $getgiftMessage = $item->giftMessage();

But I am not able to get the value.

Any help would be appreciated.


texts:
For some strange reason when I now log into my admin I am missing the the tax pages. I thought it could be a ACL issue however I am an administrator and resource access is set to all.

Any one got any ideas how I can get it back?


texts:
I got this method in my RelatedProduct class that gets related product image URL

public function getProductImageUrl($product)
{
    return $this->_storeManager->getStore()
                ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage();
}

and when I use it in my template

<img src=" <?= $product->getProductImageUrl($relatedProduct) ?> ">

the image is too large, it takes up whole screen.

How can I set the size of the image to base image size, preferably without having to add css styling for it? Can I do it in some .xml file?


texts: How to get the order details of a customer using the access token of other customer?

texts:
In my project there the two types of users: manager and captain.
The manager should be able to view the orders placed by captain so i need to use the access token of manager to get the order list of captain using the search criteria API /V1/mine/orders. Please help me to suggest how can i achieve this.

Thanks in advance.


texts: Add downloadable product to a customer without ordering

texts: I want to award a downloadable product to a certain customer. Currently the rule is normally allow downloadable products to customers who bought it. How do I allow that customer manually to download?


texts: Magento2 price issues after data migration

texts:
I have started the task of migrating to Magento2 from Magento 1.9.2.2;
So far everything has been successful except for a couple of issues.

My Environment is: Litespeed Enterprise 5.08, PHP 5.6.15, MYSQL 5.6

My Issue

1: The price field doesn't show when editing a configurable product, I have got "Use price of simple products" set to NO. I can see the price in the simple product if i edit that seperately.

2: The price in the category part of the catalogue shows the price EX tax, despite all settings being to show tax inclusive price. When i go to the category page, then choose both attribute options the price then changes to the tax inclusive price. At all times it is showing "WAS AU$XXX" on both category and product pages.


texts:
I have a problem with url. I have an url http://example.com/ but css not work because search in http://example.com/example.comcss/...

If I search a product directly insert: http://example.com/category/product/example.com/

Why insert path url at finish all time?

Thanks!


texts: How to add custom data in the output of GET API to get children of configurable product in Magento 2.3?

texts:
To get children of Configurable Product, I'm using following API

  /V1/configurable-products/{{SKU}}/children

I'm getting following output:

[
    {
        "id": 3234,
        "sku": "ABC1006",
        "name": "ABC Config Product",
        "attribute_set_id": 4,
        "price": 2400,
        "status": 1,
        "type_id": "simple",
        "created_at": "2018-12-17 13:27:58",
        "updated_at": "2018-12-18 11:06:28",
        "weight": 1,
        "product_links": [],
        "tier_prices": [],
        "custom_attributes": [
            {
                "attribute_code": "tax_class_id",
                "value": "2"
            },
            {
                "attribute_code": "required_options",
                "value": "0"
            },
            {
                "attribute_code": "category_ids",
                "value": [
                    "173"
                ]
            },
            {
                "attribute_code": "has_options",
                "value": "0"
            },
            {
                "attribute_code": "brand",
                "value": "399"
            },
            {
                "attribute_code": "short_description",
                "value": "

"
            },
            {
                "attribute_code": "image",
                "value": "/h/a/hamster-ball-32cm_7.png"
            },
            {
                "attribute_code": "small_image",
                "value": "/h/a/hamster-ball-32cm_7.png"
            },
            {
                "attribute_code": "thumbnail",
                "value": "/h/a/hamster-ball-32cm_7.png"
            },
            {
                "attribute_code": "swatch_image",
                "value": "/h/a/hamster-ball-32cm_7.png"
            },
            {
                "attribute_code": "url_key",
                "value": "savic-hamster-ball-extra-large"
            },
            {
                "attribute_code": "msrp_display_actual_price_type",
                "value": "0"
            },
            {
                "attribute_code": "size_swatch",
                "value": "213"
            }
        ]
    }
]

I want to add one more key pair (type=string) in the above json output.
Where should I make changes to get the results.


texts:
Recently I decided to create a custom layout like column1-without-sidebar or something.

I just want catalog->category page with the header and footer but without the sidebar etc.

So  Any ideas what I'm doing wrong? Also I wonder where the default Magento 2.1 column1,2,3 layout is located?

  I created a file named smakenLayout.xml in the
  /magento2/app/design/frontend/Smartwave/MY_THEME/Magento_Theme/layout.
  The code is as follow(taken from magento.stackechange):

<?xml version="1.0" ?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="empty"/>
    <referenceContainer name="page.wrapper">
        <container name="header.container" as="header_container" label="Page Header Container"  htmlTag="header" htmlClass="page-header" before="main.content"/>
        <container name="page.top" as="page_top" label="After Page Header" after="header.container"/>
        <container name="footer-container" as="footer" before="before.body.end" label="Page Footer Container" htmlTag="footer" htmlClass="page-footer" />
    </referenceContainer>
</layout>

Another file which was to declare the smakenLayout.xml was made and put in the main Magento-theme folder: /magento2/app/design/frontend/Smartwave/MY_THEME/Magento_Theme/. The code is as follow:

<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
    <layout id="smakenLayout">
        <label translate="true">Test Layout</label>
    </layout>
</page_layouts>


texts: Account Creation "/createpost/" Service Unavailable on production, works on local

texts:
I am currently having an issue with my server where creating a customer account gives this error, the account is created but it still shows this error instead of a confirmation page/redirect to account page.

My local version works perfectly. I replaced all the files from production from local and this issue still exists. The only difference I can think of is that in my production environment there may be different configuration settings. Can a configuration setting cause this?

Has anyone came across this before? Or know a possible solution? I was hoping it was just something in the configuration settings but I have been unable to find anything. The database and readable/writeable as well.

I just cannot understand why it creates the account, fails to redirect(?) and then shows a service unavailable error but my local version is okay.

Edit: To be more exact the process that fails is the login and redirect. So once you go back to say the home page you are still not logged in although you can log in afterwards.

Fix Found: So Log errors gave me nothing but I noticed when I tested an email for a sale it gave me an error.  There was a unused module that conflicted with the email process and because this caused a failure it would lock the account create procedure at the email confirmation process. Removing + Uninstalling the offending module fixed the issue immediately.


texts:
When I am trying to upgrade my Magento version from 2.1.7 CE to 2.2.0 CE, through composer update, I am getting the following error.

Problem 1
- magento/module-wishlist-sample-data 100.1.0-rc1 requires magento/module-wishlist 100.1.* -> satisfiable by magento/module-wishlist[100.1.0-rc1, 100.1.0-rc2, 100.1.0-rc3, 100.1.0, 100.1.1, 100.1.2, 100.1.3, 100.1.4, 100.1.5, 100.1.6].
- magento/module-wishlist-sample-data 100.1.0-rc2 requires magento/module-wishlist 100.1.* -> satisfiable by magento/module-wishlist[100.1.0-rc1, 100.1.0-rc2, 100.1.0-rc3, 100.1.0, 100.1.1, 100.1.2, 100.1.3, 100.1.4, 100.1.5, 100.1.6].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.0-rc1].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.0-rc2].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.2].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.3].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.4].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.5].
- Can only install one of: magento/module-wishlist[101.0.0, 100.1.6].
- magento/product-community-edition 2.2.0 requires magento/module-wishlist 101.0.0 -> satisfiable by magento/module-wishlist[101.0.0].

Here is my composer.json file, located in my project's root folder.

{
"name": "magento/project-community-edition",
"description": "eCommerce Platform for Growth (Community Edition)",
"type": "project",
"version": "2.1.7",
"license": [
    "OSL-3.0",
    "AFL-3.0"
],
"require": {
    "magento/product-community-edition": "2.2.0",
    "composer/composer": "@alpha",
    "magento/module-bundle-sample-data": "100.1.*",
    "magento/module-theme-sample-data": "100.1.*",
    "magento/module-catalog-sample-data": "100.1.*",
    "magento/module-tax-sample-data": "100.1.*",
    "magento/module-customer-sample-data": "100.1.*",
    "magento/module-cms-sample-data": "100.1.*",
    "magento/module-widget-sample-data": "100.1.*",
    "magento/module-catalog-rule-sample-data": "100.1.*",
    "magento/module-sales-rule-sample-data": "100.1.*",
    "magento/module-sales-sample-data": "100.1.*",
    "magento/module-grouped-product-sample-data": "100.1.*",
    "magento/module-downloadable-sample-data": "100.1.*",
    "magento/module-msrp-sample-data": "100.1.*",
    "magento/module-configurable-sample-data": "100.1.*",
    "magento/module-product-links-sample-data": "100.1.*",
    "magento/module-wishlist-sample-data": "100.1.*",
    "magento/module-review-sample-data": "100.1.*",
    "magento/module-swatches-sample-data": "100.1.*",
    "magento/sample-data-media": "100.1.*",
    "magento/module-offline-shipping-sample-data": "100.1.*"
},
"require-dev": {
    "phpunit/phpunit": "4.1.0",
    "squizlabs/php_codesniffer": "1.5.3",
    "phpmd/phpmd": "@stable",
    "pdepend/pdepend": "2.4.0",
    "fabpot/php-cs-fixer": "~1.2",
    "lusitanian/oauth": "~0.3 <=0.7.0",
    "sebastian/phpcpd": "2.0.0"
},
"config": {
    "use-include-path": true
},
"autoload": {
    "psr-4": {
        "Magento\\Framework\\": "lib/internal/Magento/Framework/",
        "Magento\\Setup\\": "setup/src/Magento/Setup/",
        "Magento\\": "app/code/Magento/"
    },
    "psr-0": {
        "": "app/code/"
    },
    "files": [
        "app/etc/NonComposerComponentRegistration.php"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
        "Magento\\Tools\\": "dev/tools/Magento/Tools/",
        "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
        "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
        "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
    }
},
"minimum-stability": "alpha",
"prefer-stable": true,
"repositories": [
    {
        "type": "composer",
        "url": "https://repo.magento.com/"
    }
],
"extra": {
    "magento-force": "override"
} }

Anyone know, how to fix this ?


texts:
Unable to Get meta title on category page.

$this->getLayout()->getBlock('head')->getTitle();

Error:

  Fatal error: Uncaught Error: Call to a member function getTitle() on boolean

Magento 2.3.0


texts: Magento2 auto search suggestion display issue

texts:
Magento2 auto suggestion search result showing special characters any solution?

https://i.imgur.com/o2qQboy.png


texts: Check an ajax response is json or else using prototype js

texts:
It is a simple question to all of our dear magento developer.

How can i check ajax response type is json or else using prototype js  whenever request header is not defined as application/json

  requestHeaders: {Accept: 'application/json'}

My prototype ajax request is:

new Ajax.Request(url,{
    method:'POST',
   parameters:params,
    onSuccess:function(transport){

    }.bind(this)
    });

Now  i am trying  to send different type of  header response basic on  my logic.

Condition:
if condition  is match with rule  then send json response  using below code:

  public function testAction() {
      if(ConditionMATCh) {
                      $data = array('user_id' => 1, 'name'=> 'Amit' );
              $result=Mage::helper('marketplace/assignfollowup')->addonFollowerList($data);
              return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
          }

Else   render a layout  below code:

 public function testAction() {
      if(ConditionMATCh) {
                      $data = array('user_id' => 1, 'name'=> 'Amit' );
              $result=Mage::helper('marketplace/assignfollowup')->addonFollowerList($data);
              return $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
          } else {
                                $this->loadLayout();
                                $this->renderLayout();
                                return;
      }
  }

My JavaScript ajax request cod is below

new Ajax.Request(url,{
    method:'POST',
    parameters:params,
    onSuccess:function(transport){
          if(responseISJson){

      // do someting
  }else{
      // do other
  }

    }.bind(this)
    });

Now try to do some logic basic of response type(Json/other) on above prototye ajax request  example.

Question: How can i track that response  Json or else


texts: MSQL Query to list Simple Products for missing images

texts:
Line 3 is apparently incorrectly written. Can a MySql expert offer fixed query? Thanks!

SELECT  `rscno`
FROM  `catalog_product_entity` WHERE `type_id` = 'simple'
AS a INNER JOIN  `eav_attribute` AS `attribute` ON `attribute.attribute_code` =  'image'
AND `attribute.frontend_input` =  'media_image'
LEFT JOIN  `catalog_product_entity_varchar` AS b ON a.entity_id = b.entity_id
AND b.attribute_id = attribute.attribute_id
WHERE b.value =  ''
OR b.value IS NULL
OR b.value =  'no_selection'
LIMIT 0 , 30

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS a INNER JOIN eav_attribute AS attribute ON attribute.attribute_code = ' at line 3


texts: Magento 1.8: Set category url in store view level

texts:
I have multiple websites (for each country) and each has one store view (different language). Currently categories have the same url for each store view. This, of course, brings some SEO problems.

Is it possible to set category url in store view level so we could have language specific category urls?


texts: Show payment child html form based on payment selection

texts:
I'm adding payment information section in custom theme. I've update chechout phtml code and All enabled payment methods are visible in payment information section.

I've my template code referenced from app/design/frontend/base/default/teplate/checkout/onepage/payment/methods.phtml file. I'm overwriting block Mage_Payment_Block_Form_Container.In my console I see error Uncaught ReferenceError: payment is not defined due to payment.init(); line in

   <?php echo $this->getChildChildHtml('scripts'); ?>
    payment.init();
    <?php if (is_string($oneMethod)): ?>
    payment.switchMethod('<?php echo $oneMethod ?>');
        <?php endif; ?>
    //]]>

On clicking on any particular payment method I want to load it's corresponding child html. but onclick of payment.switchMethod('<?php echo $oneMethod ?>'); the corresponding child form is not being loaded. What I need to do to load corresponding child html of any payment method given that I'm not using Magento default theme?

I'm not getting form html from my block function which is defined as

   public function getPaymentMethodFormHtml(Mage_Payment_Model_Method_Abstract $method)
    {
         return $this->getChildHtml('payment.method.' . $method->getCode());
    }


texts: When to run following commands in magento2?

texts:
Just need a clear distinction between these commands.

When to run magento setup:upgrade and
when to run setup:di:compile ?

Also when all cache is disabled, Do we still need to flush the cache and reindex indexer after any change in module ?


texts:
I was notified by one of my customer that he was unable to download the file that he bought recently. Whenever he clicks the link, website gives this error message-"An error occurred while getting the requested content. Please contact the store owner."

I tried checking this and found that he's true! I'm not able to figure out the exact reason for this. I believe the ',' and '/' at the end of download link are responsible for this error. This is link address of the downloadable file that I'm getting in front end, as a buyer.

https://www.mywebsite.com/downloadable/download/link/id/MC44NTA5MzIwMCAxNDI4ODg5NTUyMTkxNDI5Nw,,/

PS: I'm not a technical guy so any sort of detailed help will be greatly appreciated.


texts: Magento2 the custom block class had extended abstract product but to get product that was null,please help me

texts:
the code of My custom module block class

<?php
namespace  Customization\Design\Block;
use Magento\Catalog\Block\Product\AbstractProduct;

class  Design extends AbstractProduct {

    protected $_hash;

    protected $_cofig;

    /**
     * @var ProductRepositoryInterface
     */
    public function __construct(
            \Magento\Catalog\Block\Product\Context $context,
             array $data = []
    ){

        parent::__construct(
                $context,
                $data
        );
    }
}

The phtml file  code

<?php $buttonTitle = __('Add to Cart'); ?>
<?php $_product = $block->getProduct(); var_dump($_product);?>

print：NULL;


texts: Having a second left bar in the category page

texts:
Well in my page I have in the left bar show the sub categories of the category when you enter the page of the category, but my client has required that I manage to put a second left bar below the first one, this has to show the brands of the products of the category; I have the sub category of brands, but I have no clue of how to put them as a second bar in the left side of the page.

I hope you guys can help me.
Thanks in advantage.


texts:
Anyone know about this error? I get it while indexing.

Error reindexing Solr: Ping query caused exception: Bad contentType for search handler :text/xml; charset=UTF-8 request={q={!lucene}*:*&timeAllowed=5&json.nl=flat&omitHeader=true&wt=json&echoParams=all&distrib=false}

I think it's referring to this:

if (!isset($options['headers']['Content-Type'])) {
    $options['headers']['Content-Type'] = 'text/xml; charset=utf-8';
}

Also believe it has something to do with a newer version of Solr.

If I comment the above line out I get a new error:

Error reindexing Solr: missing content stream


texts:
Neither my categories and subcategories can be seen.
It has the right link (http://zoio-magento.jelastic.websolute.net.br/index.php/catalog/category/view/id/4/) but when I click on it I get "There was no 404 CMS page configured or found." (no-route ?) message...

Products can be seen thought (http://zoio-magento.jelastic.websolute.net.br/index.php/sample-product.html).

Can anyone help me with this?


texts: How to add "Compare List" into cms page?

texts:
I tried to add compare list into cms page, but it doesn't work

{{block type="catalog/product_compare" template="catalog/product/compare/list.phtml"}}


texts:
currently developing web application that utilizes magento's customer / admin tokens (magento 2).

I am trying to access my custom webapi with resource assigned as "self" using an admin user with a specific user role (customized);

Here is the senario that i am running into:

Scenario #1: Accessing the custom webapi with self resource using a customer token yields a proper response.

Scenario #2: Accessing the custom webapi with self resource using an admin token with the default Administrator role (with all resources enabled) yields a proper response.

Scenario #3: Accessing the custom webapi with self resource using an admin token with a customized admin role (all resources enabled except for custom resources defined by my ACL file) yields a response of :

{
    "message": "Consumer is not authorized to access %resources",
    "parameters": {
        "resources": "self"
    }
}

If i understood magento's Authentication system for webapi correctly, regardless of what resources admin users have, they should all have access to the self, resource, webapi.

It is necessary that i use magento's role to identify the administrative levels of each admin users, however, this prevents me from calling webapis with the resource self.

Any idea whether this is a bug or maybe i'm doing something wrong?
I did do a web search for similar cases, and found no solution. Thus, any help would be appreciated, thanks.

My config files are formatted as follows:

webapi.xml:

<?xml version="1.0"?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route url="/V1/foo/bar/:entity_id" method="GET">
        <service class="Foo\Bar\Api\BarManagementInterface" method="get"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

    <route url="/V1/foo/bar/" method="GET">
        <service class="Foo\Bar\Api\BarManagementInterface" method="getList"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

    <route url="/V1/foo/bar/" method="POST">
        <service class="Foo\Bar\Api\BarManagementInterface" method="save"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

    <route url="/V1/foo/bar/:entity_id" method="DELETE">
        <service class="Foo\Bar\Api\BarManagementInterface" method="delete"/>
        <resources>
            <resource ref="Custom_Permission::permission_management"/>
        </resources>
    </route>

</routes>

acl.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
  <acl>
    <resources>
      <resource id="Magento_Backend::admin">
        <resource id="Custom_Permission::permission" title="Custom Permission" sortOrder="100">
          <resource id="Custom_Permission::permission_management" title="Management" sortOrder="101"/>
        </resource>
      </resource>
    </resources>
  </acl>
</config>

di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Foo\Bar\Api\BarManagementInterface" type="Foo\Bar\Model\BarManagement" />
</config>


texts: Add custom field to contact form Magento 2?

texts: I'm using magento 2 and I would like to add a custom field to the contact form , how I would be able to do that ?


texts: Additional cache management buttons not showing after magento upgrade

texts:
I upgraded magento 2.2 to 2.3.7. After upgrade Additional Cache Management buttons missing.
If anyone know reason for this, please suggest me some idea.


texts:
any idea why in search result the filter box goes below the catalog listing?
is there a way to fix that


texts: Add product customizable option to product cart programatically Magento 2

texts:
I created a custom option in backend like this:

I have a custom extension to call a controller which will add the product to cart programmatically like this:

public function __construct(
      Context $context,
      \Magento\Catalog\Model\ProductRepository $productRepository,
      \Magento\Checkout\Model\Cart $cart, \Magento\Framework\Data\Form\FormKey $formKey,
      \Magento\Framework\Event\Observer $observer
    ){
        $this->_productRepository = $productRepository;
        $this->_cart = $cart;
        $this->formKey = $formKey;
        $this->observer = $observer;
        parent::__construct($context);
    }

    public function execute()
    {
        $observer = $this->observer;
        $option = '95';
        $productId = '14';
        $qty = '1';

        $params = array(
            'product' => $productId,
            'qty' => $qty
        );
        $_product = $this->_productRepository->getById($productId);
        $customOptions[] = $option;
        $_product->setOptions($customOptions);
        $this->_cart->addProduct($_product,$params);
        $this->_cart->save();
    }

But I got an error like this:

PHP Fatal error:  Uncaught Error: Call to a member function groupFactory() on string in /var/www/project/vendor/magento/module-catalog/Model/Product/Type/AbstractType.php:580

the option for this product is defined like this:

Array
(
    [option_id] => 18
    [product_id] => 14
    [type] => drop_down
    [is_require] => 1
    [sku] =>
    [max_characters] => 0
    [file_extension] =>
    [image_size_x] => 0
    [image_size_y] => 0
    [sort_order] => 1
    [default_title] => Phone Model
    [store_title] =>
    [title] => Phone Model
    [default_price] =>
    [default_price_type] =>
    [store_price] =>
    [store_price_type] =>
    [price] =>
    [price_type] =>
)

i got the above array result by using this code:

$customOptions = $this->objectManager->get('Magento\Catalog\Model\Product\Option')->getProductOptionCollection($_product);
        foreach ($customOptions as $customOption) {
          echo "<pre>";
          print_r($customOption->getData());
        }
        exit;

the value for this option is defined in variable $option


texts:
I've been trying to get correct product urls for orders. By that I mean that when an order is created, i want to get the product url which will correspond to the store in which the order was made.
At first I've been using the getProductUrl() but this method sometime returned to me urls with admin path.
My second try was using the following code:

Mage::app()->getStore($order->getStoreId())->getUrl($product->getUrlKey());

However, sometimes I get invalid urls.

What is the correct way to get a valid product url for each order, which will correspond to the correct store?

Thanks


texts: Add Sku and item price in checkout page order summary

texts:
I need to add product sku(as item code) and item price (as item cost) in Checkout page-> Order Summary.
Unlike other pages, checkout page is rendered with KnockoutJS, its very hard to add/edit things.

Can someone help me with this please? It should be something like below image.

Update

I need to get just sku for the particular product without creating any plugins. I don't know if this is accurate, but I think in default Luma theme sku is available there,[source-Here,in this question] and sku should available like qty is available. Please help me


texts: shipping option is not showing on paypal review order page and update order button is not working

texts: i am working on magento 1.8.0 i have configured paypal express checkout in my store. all goes in payment process until process reached to review order page. here it will not showing shipping method option and update order button is also not working and place order button is disabled. so can anyone help me in this problem.


texts: Magento 2 - Checkout. Remove "New Address" from billing address drop down

texts:
I am trying to remove the "New Address" option in the billing address select.
(I don't want customers to be able to add a new billing address).

I have tried hiding it via css: select[name="billing_address_id"]:last-child { display:none; } and also by jQuery: $("select[name=billing_address_id] option:last").remove();

I have also tried removing it from vendor\magento\module-checkout\view\frontend\web\js\view\billing-address.js:

        var lastSelectedBillingAddress = null,
        //newAddressOption = {
            /**
             * Get new address label
             * @returns {String}
             */
        //    getAddressInline: function () {
        //        return $t('New Address');
        //    },
        //    customerAddressId: null
        //},
        countryData = customerData.get('directory-data'),
        addressOptions = addressList().filter(function (address) {
            return address.getType() == 'customer-address';
        });

    addressOptions.push(newAddressOption);

But all 3 solutions have failed.

(of course I have refreshed the cache, deployed static content, deleted pub/static/frontend/*)

Anyone have a clue?

Thanks