texts: Undefined Variable trying to show GeoLocation on Magento 2 product page

texts:
I am trying to look up the visitor's location and show this on the product page. It's going to be used to send them a personalised message based on location but currently, I am struggling to get it to show the current state.

If I put the code in a normal PHP file and load this it works fine but when I try this on a custom block in a .phthm file I get an error loading the product page saying undefined variable.

I can pull product details but not sure how I correctly define and show this on a product page.

  Exception #0 (Exception): Notice: Undefined variable: ip in
  /home/staging/public_html/app/code/drumbeat/tabmodule/view/frontend/templates/shipping2.phtml
  on line 76

<?php

function ip_info($ip = NULL, $purpose = "location", $deep_detect = TRUE) {
    $output = NULL;
    $state=NULL;
    $ip=NULL;
    global $ip;
    global $state;

    if (filter_var($ip, FILTER_VALIDATE_IP) === FALSE) {
        $ip = $_SERVER["REMOTE_ADDR"];
        if ($deep_detect) {
            if (filter_var(@$_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP))
                $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
            if (filter_var(@$_SERVER['HTTP_CLIENT_IP'], FILTER_VALIDATE_IP))
                $ip = $_SERVER['HTTP_CLIENT_IP'];
        }
    }
    $purpose    = str_replace(array("name", "\n", "\t", " ", "-", "_"), NULL, strtolower(trim($purpose)));
    $support    = array("country", "countrycode", "state", "region", "city", "location", "address");
    $continents = array(
        "AF" => "Africa",
        "AN" => "Antarctica",
        "AS" => "Asia",
        "EU" => "Europe",
        "OC" => "Australia (Oceania)",
        "NA" => "North America",
        "SA" => "South America"
    );
    if (filter_var($ip, FILTER_VALIDATE_IP) && in_array($purpose, $support)) {
        $ipdat = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=" . $ip));
        if (@strlen(trim($ipdat->geoplugin_countryCode)) == 2) {
            switch ($purpose) {
                case "location":
                    $output = array(
                        "city"           => @$ipdat->geoplugin_city,
                        "state"          => @$ipdat->geoplugin_regionName,
                        "country"        => @$ipdat->geoplugin_countryName,
                        "country_code"   => @$ipdat->geoplugin_countryCode,
                        "continent"      => @$continents[strtoupper($ipdat->geoplugin_continentCode)],
                        "continent_code" => @$ipdat->geoplugin_continentCode
                    );
                    break;
                case "address":
                    $address = array($ipdat->geoplugin_countryName);
                    if (@strlen($ipdat->geoplugin_regionName) >= 1)
                        $address[] = $ipdat->geoplugin_regionName;
                    if (@strlen($ipdat->geoplugin_city) >= 1)
                        $address[] = $ipdat->geoplugin_city;
                    $output = implode(", ", array_reverse($address));
                    break;
                case "city":
                    $output = @$ipdat->geoplugin_city;
                    break;
                case "state":
                    $output = @$ipdat->geoplugin_regionName;
                    break;
                case "region":
                    $output = @$ipdat->geoplugin_regionName;
                    break;
                case "country":
                    $output = @$ipdat->geoplugin_countryName;
                    break;
                case "countrycode":
                    $output = @$ipdat->geoplugin_countryCode;
                    break;
            }
        }
    }
    // return $output;
}

?>

Hello

<?php echo $ip('State'); ?>


texts: how to import sample data of magento 1.9 in PhpMyAdmin

texts:
Hi friends i am new to magento and i am trying to import a sample data of magento 1.9.0.1  but i am getting the following error :

You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.

Please help me to import the data in PhpMyAdmin and thanks in advance for your answers and suggestions Thanks a lot


texts:
Anyone can help..

Whats the possible issue for this error:

https://www.screencast.com/t/9ihnF6WdP

Thanks.


texts: Magento 2 - Is it possible to turn off search terms

texts: Is it possible to turn off autocomplete or popular search terms? We have a few of these show up when you put in certain keywords and it just looks ugly.


texts: Custom Module: Blocks and Templates not display

texts:
I have custom module and created controller. It works perfect. But I can not get block. My files are as below:

Config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Sevenbits_Demo>
            <version>1.0.0</version>
        </Sevenbits_Demo>
    </modules>
    <global>
        <models>
            <demo>
            <class>Sevenbits_Demo_Model</class>
            </demo>
        </models>
        <helpers>
            <demo>
            <class>Sevenbits_Demo_Helper</class>
            </demo>
        </helpers>
        <blocks>
            <demo>
            <class>Sevenbits_Demo_Block</class>
            </demo>
        </blocks>
    </global>

    <frontend>
        <routers>
            <demo>
                <use>standard</use>
                <args>
                        <frontName>Demo</frontName>
                       <module>Sevenbits_Demo</module>
                </args>
            </demo>
        </routers>
        <layout>
            <updates>
                <demo>
                    <file>demo.xml</file>
                </demo>

            </updates>
        </layout>
    </frontend>

</config>

demo.xml (layout/demo.xml)

<?xml version="1.0"?>
<layout version="0.1.0">
       <demo_index_index>

            <referance name="content">
             <block type="core/template" template="demo/welcome.phtml"></block>

            </referance>
        </demo_index_index>
</layout>

welcome.phtml

welcome to world of heaven.

IndexController.php (controllers/IndexController.php)

<?php

class Sevenbits_Demo_IndexController extends Mage_Core_Controller_Front_Action
{

    public function indexAction()
    {
        $this->loadLayout();
       // print_r($this->getLayout()->getUpdate()->getHandles());
        return $this->renderLayout();

    }
}

Welcome.php (Block/Welcome.php)

<?php
class  Sevenbits_Demo_Block_Welcome extends Mage_Core_Block_Template
{
    public  function _construct()
    {
        parent::_construct(); // TODO: Change the autogenerated stub
        $this->setTemplate("demo/welcome.phtml");
    }
}

Debug through this one:

 print_r($this->getLayout()->getUpdate()->getHandles());

output:

Array ( [0] => default [1] => STORE_default [2] => THEME_frontend_rwd_default [3] => demo_index_index [4] => customer_logged_out )

Output is this : https://drive.google.com/file/d/0B8PWEkckbXCURG9Qdk14YzdEZW8/view?usp=sharing


texts: Is there a way to restore the pages, blogs and widgets I have removed from Magento 2? I want the contact us, cookies and other pages back. Do I need to do it manually?


texts:
please visit link , product image is serving from cache path :

media/catalog/product/cache/1/image/350x350/9df78eab33525d08d6e5fb8d27136e95/i/m/img26_1.jpg

we want to change to below path.

media/catalog/product/i/m/img26_1.jpg

i am trying following code in media.phtml but its not working for me.

<?php echo formatPath($_img->resize($w, $h)); ?>

media.phtml

<?php
function formatPath($mediaFile = '')
{
    $main = $mediaFile;

$mainArray = explode('/', $main);
$countArray = count($mainArray);
return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'catalog/product/'.$mainArray[$countArray-3].'/'.$mainArray[$countArray-2].'/'.$mainArray[$countArray-1];
}
 ?>

<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
    $dexxtz = Mage::helper('productzoom');

    $dexxtz->getCss();
    $dexxtz->getJs();
?>

        <img class="etalage_thumb_image" src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($_product, 'image')); ?>" />
        <img class="etalage_source_image" title="<?php echo $_product->getImageLabel(); ?>"
        src="<?php echo formatPath($_img->resize($w, $h)); ?>" />

    <?php
        foreach ($this->getGalleryImages() as $_image) {
            if(Mage::registry('current_product')->getImage() != $_image->getFile()) { ?>

                <img class="etalage_thumb_image"
                src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile())); ?>" />
                <img class="etalage_source_image" title="<?php echo $_image->getLabel(); ?>"
                src="<?php echo $dexxtz->getImageFeatured($this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()), true); ?>" />

        <?php
            }
        }
    ?>


texts: How to use AED currency in PAYPAL for other currency in Magento2

texts: I have a magento2 store with base currency AED. Paypal doesn't support AED. How to make support for this currency in Magento 2 for Paypal.


texts: Handlebar Block wont display products on homepage

texts:
I've inserted:

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="3" template="catalog/product/3columns-list.phtml"}}

on the homepage cms page.

The products from category 3 All display in magento 1.9.1 but the same code does not work for magento 1.9.2.3.

Any ideas what has changed or be the issue?


texts: Magento 2: add existing attribute to product

texts:
I have a question, is there a way to add existing attributes to new product? I have some attributes already created in my admin panel and want to add them programmatically , I guess there should be something  like this in Product Factory

$_product->setAttribute("Attribute or value of the attribute");


texts: Could a hybrid data model, like using JSON in fields, allow us to eliminate the need for EAV within something like magento 2?

texts:
I was reading about EAV, and what options are available to avoid the pain caused by it, and stumbled upon using JSON in fields.

This mariadb feature page shows an example like,

SELECT name,
   JSON_VALUE(attr, "$.email.personal") AS email,
   JSON_VALUE(attr, "$.social.twitter") AS twitter,
   JSON_VALUE(attr, "$.interests[0]") AS favorite_interest
FROM   tbl_user_profiles
WHERE  user_id = "sjohnson";

The JSON is the part that would be a problem, if it was defined in a relational table's schema.  Is this really as viable as it looks at first glance?


texts: Problem with intval on numbers with more than 10 digits?

texts:
I have to insert the last_trans_id of the last purchase made into a database. I am using initval() to change an integer to string but it ends up the same value like this 2147483647.

Any idea what else can i use i have tried these methods:

number_format($value['last_trans_id'], 0, '', '');

initval($value['last_trans_id']);

(string)$value['last_trans_id'];

number_format($value['last_trans_id']);

No success til now. any idea how to solve this? Thank you


texts: Magento 2.4 allow admin to add out of stock product from admin order

texts:
In magento 2.4 we can not add out of stock product while placing order from admin. I have requirement that admin should be able to order from admin side even the products are out of stock. I see the backorder but I want it only for admin side.
Thanks in advance.


texts:
In magento 2 how to add custom options in action apply field in cart price rule form in admin

In admin panel -> marketing ->cart price rule -> add new rule

Image:

Reference Image


texts: Does anyone have the problem when you try to open a Magento marketplace?


texts:
How is the workaround with multi-store, if I want to add different style with the CSS.

In one of the stores, i want to hide the old price (Just by settings the font-size to 0px). The stores is on following URL xxxxxxx.dk/store1 and xxxxxxx.dk/store2

How can i make the CSS only take affect on store1, and keep the default for store2

.page .category-products .products-container ul li.item .price-box .old-price .price {
    font-size: 0px;
    text-decoration: line-through;
    color: #d3d3d3;
    line-height: 20px;
    text-decoration: none;
    font-weight: 700;
    float: none;
}

EDIT:

I have tried with the following settings:

But it look like this:

My standard page works fine, do you have any suggestions?


texts: What is the best way to restrict the access to the admin area by IP in Magento? Bear in mind that admin can work either from /admin or index.php/admin


texts: Magento 1.9.2 coupon( discount) not appearing while creating invoice

texts:
We are currently using magento 1.9.2 and facing some issue, discount is not showing on invoice. Neither on invoice pdf nor on invoice page. This issue only appear if order is created from magento admin and if order is created from frontend then invoice shows discount price( coupon code also) and also shows us in pdf.

This issue happens only in invoice because we can easily see the discount coupon on order created page.I have also attach the screen shot.

Thanks


texts: Magento sending too many order email copies

texts:
I just upgraded to Magento CE 1.9.1 from 1.6.2 and we're having issues with the sales order emails now.

In system > config >sales order emails > order > send order email copy to, we have two emails set.

Magento sends an order confirmation email to the customer, and two to each of the emails we have in the send order email copy box. If we put three emails, magento sends three emails to those addresses.

This appears to be the same issue in this thread.
Magento after upgrading order update email sending duplicate emails

Does anybody have any idea what the issue could be?

Thank you


texts:
I have changed the Allowed Countries within Magento to only show United Kingdom, however, we only want to accept orders for the UK Mainland, which excludes Ireland (the UK includes Scotland, Northern Ireland, England and Wales).

I've tried researching this but I cannot find anything to change this. Any ideas?


texts: Which table in Magento 2.3.4 to look for if I need to update the options for Migration_Design attribute

texts: which table in Magento 2.3.4 to look for if I need to edit the options for Migration_Design attribute. All I want to do is to ensure the value for Custom Layout Update is only 'No Update' displayed without "Use Existing" dropdown option. If there are alternatives, I shall also be interested. Please refer the image below to see what I am looking to do for each product.


texts:
$callbackUrl = "http://yourhost/oauth_customer.php";
$temporaryCredentialsRequestUrl = "http://magentohost/oauth/initiate?oauth_callback=" . urlencode($callbackUrl);
$adminAuthorizationUrl = 'http://magentohost/oauth/authorize';
$accessTokenRequestUrl = 'http://magentohost/oauth/token';
$apiUrl = 'http://magentohost/api/rest';
$consumerKey = 'yourconsumerkey';
$consumerSecret = 'yourconsumersecret';


texts: Curl request doesn't login to my API, why?

texts:
I've been working on this code to log in to my API. But every time I try to login using CURL I get the following error

{"message":"The request entity's media type 'multipart/form-data' is not supported for this resource.","exceptionMessage":"No MediaTypeFormatter is available to read an object of type 'Credentials' from content with media type 'multipart/form-data'.","exceptionType":"System.Net.Http.UnsupportedMediaTypeException","stackTrace":" at System.Net.Http.HttpContentExtensions.ReadAsAsync[T](HttpContent content, Type type, IEnumerable1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)\r\n at System.Web.Http.ModelBinding.FormatterParameterBinding.ReadContentAsync(HttpRequestMessage request, Type type, IEnumerable1 formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)"}

My code is simply meant to login to my ERP system using a static username and password. The code is as follows:
$logindata = array(
    'name' => 'username',
    'password' => 'password'
);
$headers = array(
    'Content-Type' => 'application/json'
);
$ch = curl_init($url);
//        curl_setopt($ch,CURLOPT_COOKIEJAR, $this->cookie_jar);
//        curl_setopt($ch,CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, False);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, False);
curl_setopt($ch, CURLOPT_ENCODING, "");
curl_setopt($ch,CURLOPT_MAXREDIRS,0);
curl_setopt($ch,CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $logindata);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
$err = curl_error($ch);
if ($err) {
    echo "cURL Error #:" . $err;
} else {
    echo $response;
}

What am I doing wrong? and how can I fix it?
EDIT 1:
I tried curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($logindata)); and while that stopped showing the error that I showed earlier, it still says that I'm not logged into the API and thus I'm still unable to use it further.

string(36) "{"message":"You are not logged in."}"


texts: Migration error Magento 1.9.3.2 to 2.1.8

texts:
I have Migrated from Magento ver 1.9.3.2 to Magento ver 2.1.8 successfully using Data Migration tool.

In admin, catalogs and customers showing fine on grid but after clicked on it showing below error:

  (Magento\Framework\Exception\LocalizedException): The requested
  component ("datetime") is not found. Before using, you must add the
  implementation


texts:
I want to display media or image box inside another phtml. I am using this code but the getchildhtml() return nothing.

$block = Mage::getBlockSingleton('catalog/product_view');
$block->setProduct($_product); //$_product is the product object
$blockMedia = Mage::getBlockSingleton('catalog/product_view_media');
$block->setChild('media',$blockMedia);
echo $block->getChildHtml('media');

May be because the media is the child block of catalog/product_view.


texts: What is the difference of Mage::getStoreConfig() and getConfigData()

texts:
Please explain me what is the difference of

$this->getConfigData('xyz') and Mage::getStoreConfig('abc/xyz/hfc').

What is the difference of both function.


texts: Magento 2 States are not Loading while Selecting Country on New Account Create Page

texts:
I have customize the New account Create page(Registration page) in Magento 2.3

And Also enabled the option country and state. But when selection country state is not loading.

I have checked the admin->General->Country Option->state Options and set the state is required for all country, but still it is not working.

Is there is any other settings that will require to load the state option.

Please share your idea and help me to resolve that issue.


texts:
I need to export the following customer information from our Magento site:

First name
Last name
Email
Store ID

Trying to do so via System > Import/Export > Dataflow - Profiles just times out, despite several attempts at increasing various PHP memory and timeout limits on the server.

Please can someone help?

Thanks in advance.

Mark


texts: Cancel discount on creditmemo when conditions do not match anymore

texts:
I have a discount code that gives a client 20 euro discount on an order, if the cart contains a specific SKU (this is just an example, it could also be an attribute color with the value blue).

This works, so far so good.

Then an order gets placed with 2 products and the customer decides to return the product with the sku 'TEST15335' (which is in the conditions).

So I create a creditmemo with the following settings;

The problem is immediately apparent; the discount of 20 euro is spread out over the products in the cart, based on the percentage of the product price of the total.

The first product percentage of total is;
79.95 / 129.90 * 100 = 61.547344111
So the discount for that row is;
20 * 0.61547344111 ~= 12.31

So when I refund this, 12.31 discount will be 'refunded'. The problem is; without this product in the cart, the total discount of 20 euro should not be applied, so the discount that will be 'refunded' should be 20 instead of 12.31. Is there any way to re-validate the discount code when the creditmemo is created so the full amount will be 'refunded' ?

I am aware of the functionality that you can apply discounts on specific items in the cart by utilising the 'Apply the rule only to cart items matching the following conditions (leave blank for all items' field under 'Actions', and that will work in this specific case but there are cases where it might not so I'd like a more generic approach for this (which will then include already placed orders with a coupon code that is 'configured incorrectly').

Edit; an example would be a 20 euro discount when the cart subtotal is larger than 75 euro. The subtotal would then be 55 euro. After returning a product that causes the non-discount subtotal to dip below 75 euro, only the discount for that product is 'refunded'.


texts: Magento 2 data migration tool delta mode Delta delivering failed

texts:
I have migrated my store data from magento1.9.3.10 to magento2.3.3 1 month before using magento2 data-migration-tool, all know migration take months so client has updated their catalog in magento1.9.3.10, because he was not waiting to let migration complete and then update the catalog.
I have studied and get to know delta:mode is develop for this purpose.
Reference link
github community
when I run this command then I get this Error

[2020-11-09 10:12:33][ERROR]: Deltalog for
catalog_product_super_attribute_pricing is not installed In Delta.php
line 129:
Delta delivering failed

I have studied when we run migrate:data step then tool creates some tables like m2_cl_catalog_category_entity, m2_cl_...... which are using in delta mode, but i don't find any table which starts from m2_cl_... in my m2 database.
Can anyone guide me what is the main cause of not creating these tables(m2_cl...) in the migrate:data step?
how can I sync my catalog?


texts: Magento 2 - How to create custom files and get their URL?

texts:
I have a custom module which should create a pdf file each time a user clicks a button. Ideally the PDF would be created in MyVendor_MyModule::pdfFiles/mypfd123.pdf but it can be created anywhere else if it can't be done inside my module folder.

after creating that pdf, I would need to get its url in order to open a new tab showing it.

I already know how to create the file, I just don't know how to tell magento that I want to place it in my module folder. Also I don't know how to get its absolute URL.


texts: How many ways are there to create a controller and what are they?

texts:
I have been developing with Magento 1.9 for the last two weeks. I have found several problems to develop each project (probably because my first project with magento had a high level...).

I come from developing mainly with Yii Framework and sometimes I do not find the way to develop some things which were very easy using Yii.

Using Yii, I could create a controller, add a function actionPage and I could access the controller/page url. However, using Magento, I only have seen that everything is done through a module.

Then I would like to know some real life example about "when I should create a controller with a module". On the other side, I would like to know if there is another way to develop a controller. This is only a theorical question.

Thanks.


texts: 404 Not Found on every page except index.php and on Fresh Install?

texts:
I installed Magento 1.9.0.0 community today.

I could not install Magento with the permissions I set reading
the install guide.

(First the pictures did not show up on the install page due to permission problems, then the "continue" button would not click due to the permissions on the js directory)

I changed the permissions on the directories and files of: js, media, skin, var
to 777. What should the permissions be? (I have 700 for directories and 600 for files of all other directories and files).

Then the install worked but got the

"Response from server is invalid"

and had to click:

"Skip Base URL Validation Before the Next Step"

to continue.

I finished the install and every single page I go to gives me a 404 not found error.

Except the index.php.

Check out my page for your self

ifiluv.com

ifiluv.com/admin    (does not work)

however adding ifiluv.com/index.php/admin

seems to work.

Also in the configuration changing

Use Web Server Rewrites : to NO

fixes a lot of the links and they work but they don't all work (like ifiluv.com/admin.

So I turned Web Server Rewrites back to YES. I read its bad to turn this off anyways.

Please Help! :*(


texts:
how can i center all the text on my product pages.

Now it's left lined. See image attached.

And is it possible, to place the code over here:


texts: Persistent errors in Magento 2 make the installation unusable

texts:
I am developing an extension for magento 2.1.5. In development phase, when my module has certain errors for example schema validation errors or generic php errors or naive developer mistakes, my magento installable is unable to recover from them. Even if I remove the whole module that I was working on from app/code/ directory, I still see the same errors.

The magento commands for setup, clearing cache start throwing the same error and my installation becomes unusable. I can not open the admin portal as well.

I have tried clearing the cache from var/cache and generation directories without any success. Also tried disabling the module manually. Any insights?


texts:
Hi there i am facing the following error when trying to test whether soap client is working or not:

XML Parsing Error: mismatched tag. Expected: </schema>.
Location: http://localhost/magento/index.php/api/?wsdl=1
Line Number 13, Column 15:            </complexType

i am hitting the following url to reach out to the wsdl

http://localhost/magento/index.php/api/?wsdl=1

i have started working with magento and trying to access its webservice.


texts: How do I add canonical url to header in AW BLOG extension?

texts:
Recently we saw many duplicate content hits in our blog and this is not good for SEO

This is due to using aw_blog not adding a canonical tag (actually there has not been any real development - other then urgent security fixes)

Question: How can we add a canonical tag to aw blog?

We were thinking of adding it to _prepareMetaData in Abstract.phtml

protected function _prepareMetaData($meta)
{
    if (is_object($meta)) {
        $head = $this->getLayout()->getBlock('head');
        if ($head) {
            $head->setTitle($meta->getTitle());
            $head->setKeywords($meta->getMetaKeywords());
            $head->setDescription($meta->getMetaDescription());


texts: How to enable AJAX for the the 'Add to Cart' button of product widgets in Magento 2?

texts:
In Magento 2 the normal Add to Cart button has a very nice AJAX-based logic to add products to the cart.
However, when we use a Catalog Products List widget for example in CMS pages the button in this products list works with an HTTP POST which reloads the current page.

User experience suffers from this and it would be desirable if the button would have the same AJAX logic like in the default category product lists or on product pages.

How can we extend the Catalog Products List widget so that it uses the better Add to Cart button? Or is there maybe another workaround?


texts: Magmi importer not associating simple products, not associating images or some attributes

texts:
I used the attached spreadsheet to upload a configurable product and some simple products that are to be associated with the configurable. I used Magmi to upload the items and and not only did the images not populate in the items but some attributes didn't either. In addition, the configurable was not created or associated with the simple products. What am I doing wrong?

Best,

Ariel

I just realized that the file I linked to this page was not really viewable. Let's try this one. https://docs.google.com/spreadsheets/d/172Duq3_iuLoT0PUUsmD9JAQ6bihfwf6VNyDn2yAAdOQ/edit?usp=sharing


texts:
I want to make a function allowed customer upload file in My Account

here is description image

Any helps? Thank in advance.


texts: Magento2 throws an incompatible arguement type error during compilation

texts:
See below for the code which throws the error.

<?php

namespace Vendor\RedExpress\Model\Carrier;

use Magento\Quote\Model\Quote\Address\RateRequest;
use Magento\Shipping\Model\Carrier\AbstractCarrier;
use Magento\Shipping\Model\Carrier\CarrierInterface;

/**
 * Custom shipping model
 */
class Redexpress extends AbstractCarrier implements CarrierInterface
{
    /**
     * @var string
     */
    protected $_code = 'redexpress';

    protected $_curl;

    protected $_logger;

    /**
     * @var bool
     */
    protected $_isFixed = true;

    /**
     * @var \Magento\Shipping\Model\Rate\ResultFactory
     */
    private $rateResultFactory;

    /**
     * @var \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory
     */
    private $rateMethodFactory;

    /**
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory
     * @param \Psr\Log\LoggerInterface $logger
     * @param \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory
     * @param \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory,
        \Psr\Log\LoggerInterface $logger,
        \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
        \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory,
        \Magento\Framework\HTTP\Client\Curl $curl,
        array $data = []
    ) {
        parent::__construct($scopeConfig, $rateErrorFactory, $logger, $curl, $data);

        $this->rateResultFactory = $rateResultFactory;
        $this->_logger = $logger;
        $this->rateMethodFactory = $rateMethodFactory;
        $this->_curl = $curl;
    }

Please, I would appreciate a solution to this problem as i am very new to working with magento.


texts:
My custom CRON job not working automatically, but if I run it using command line then it is working.

I created basic module and below is my code for CRON job

crontab.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="cron_example" instance="companyname\modulename\Cron\Example" method="execute">
            <schedule>* * * * *</schedule>
        </job>
    </group>
</config>


texts: Accessing block from controller in magento2

texts:
I'm trying to use functions in \Magento\Swatches\Block\Product\Renderer\Listing\Configurable directly from my controller.
Ive created an instance like this :
$swatchInstance = $this->layoutFactory->create()->createBlock('\Magento\Swatches\Block\Product\Renderer\Listing\Configurable');

but when i try to use functions like
$swatchInstance->getJsonSwatchSizeConfig()

I am getting the error

Uncaught Error: Call to a member function getTypeInstance() on null


texts:
I am trying to create a module that will allow you can define a custom url for a category.

The navigation menu will link to a custom page and have the correct URL listed in the sitemap.

I was able to create the custom attribute for the category and it shows in admin but when I try to extend "Mage_Catalog_Model_Category" to overwrite the "getUrl" function, but I am not able to access my new custom attribute. See below for code. I just want to use the "custom_category_url" (if there is a value) otherwise fallback to the parent getUrl function, but currently $this->getData('custom_category_url') is always returning NULL.

I assume I need to do something so that the attribute is available at this point but I am not sure how. The full code is available at :

  https://github.com/americanstationery/AmstatCustomUrl

<?php
class Amstat_CustomUrl_Model_Category extends Mage_Catalog_Model_Category
{
    /**
    * Get category url
    *
    * @return string
    */
    public function getUrl() {
        $categoryRedirectUrl = $this->getData('custom_category_url');
        if(strlen($categoryRedirectUrl) > 0 && $categoryRedirectUrl != '0'){
            return $categoryRedirectUrl;
        }
        return parent::getUrl();
    }
}


texts: Receive Error Some item options or their combination are not currently available

texts: In order to receive this error some item options or their combination are not currently available what i need to change in a product


texts: Single Static Block Linking To 50 Different URLs

texts:
I have a banner image that I need to display in approximately 70 categories on my website.

The banner will link from one specific category to another specific category, but will be different every time.

Example:
Banner in category 1, will link to category 1a.
Banner in category 2, will link to category 2a.
Banner in category 3, will link to category 3a.
And so on...

Is there a way to control the link URL of the banner in a way that means I only have to create a single static block to handle this, such as code that checks which category the banner is being displayed in, and having that determine the link URL applied to the banner.

This would mean I can use a single static block...

Or am I stuck with creating 70 static blocks because I need each banner to link to 70 different categories?


texts: How to Change wysiwyg editor default p tag FONT Magento

texts:
I'm using Magento with the WYSIWYG editor - and we're in the processing of converting the entire site to use the Verdana Font, the issue is, whenever we create CMS pages the WYSIWYG editor uses arial as the default, and include <p> tags - which is fine, but the font is wrong.

How do I change it so <p> tags use a css font that prioritizes Verdana instead of Arial.

I've checked all the styles.css and all of the wysiwyg editor files for both js and css and found every single Arial font settings and changed it to Verdana, but the edit still insists of putting Arial as the default.

I don't want to add additional tags in each CMS page to change the font from Arial to Verdana for every paragraph or header. I want to switch out the default.

If anyone can help, it would be greatly appreciated!


texts: Magento2: How to correctly render a json in grid field

texts:
I created a field in my order grid table, I have an observer set up that will fill the field with a JSON string of the ordered items. I want to have this field rendered to HTML so the ordered items will show on order grid. However, I can not find any information on how to properly render a JSON in UI grid system of Magento 2. I am planning to share it in a public repository so I would like to have the code as clean as possible. I have the following code right now:

namespace Qxs\OrderLinesGrid\Ui\Component;

class Grid extends \Magento\Ui\Component\Listing\Columns\Column {

  /**
  * Logger Interface
  *
  * @var \Psr\Log\LoggerInterface
  */
  protected $logger;

  public function __construct(
      \Magento\Framework\View\Element\UiComponent\ContextInterface $context,
      \Magento\Framework\View\Element\UiComponentFactory $uiComponentFactory,
      \Psr\Log\LoggerInterface $logger,
      array $components = [],
      array $data = []
  ){
      $this->logger = $logger;
      parent::__construct($context, $uiComponentFactory, $components, $data);
  }

  public function prepareDataSource(array $dataSource) {
    if (isset($dataSource['data']['items'])) {
      foreach ($dataSource['data']['items'] as & $item) {
        if (!empty($item['order_lines'])) {
          $json = $item['order_lines'];
          $this->logger->debug("JSON Data".$json);
        }
      }
    }
    return $dataSource;
  }
}

However I cannot edit the JSON it returns an empty string, the JSON is showed in the grid but not on var_dump($json). Can anybody guide me in the right direction?


texts:
Flushing REDIS Cache
Will either of the buttons FLUSH REDIS?


texts: Update database with new data (products, categories etc)

texts:
We have a live magento site with version 1.7.

In a dev installation (magento 1.9) , we had put a snap of live site database.

In dev site, we have changed theme, we have added some extension and we have done some other changes.

While we worked at dev site, in live site we have added products, we have had sales, more customers added etc.

How we can update dev database (with new products, new customers, new sales from live site database) without losing other changes we have made in dev site?


texts: custom payment module is not showing in checkout (frontend)

texts:
i need help for payment method, is showing on the backend but not in the frontend
this is the url for the module that am using

http://www.junaidbhura.com/how-to-make-a-custom-magento-payment-extension-for-an-external-gateway/

can please somebody help me with this..(magento 1.7.0.2)

Regards


texts:
This is my custom class:

class Collection extends \Magento\CatalogSearch\Model\ResourceModel\Search\Collection
{

public function _getSelectCountSql($select = null, $resetLeftJoins = true)
{

    $this->_renderFilters();
    $countSelect = is_null($select) ? $this->_getClearSelect() : $this->_buildClearSelect($select);
    if(count($this->getSelect()->getPart(\Zend_Db_Select::GROUP)) > 0)
    {
        $countSelect->reset(\Zend_Db_Select::GROUP);
        $countSelect->distinct(true);
        $group = $this->getSelect()->getPart(\Zend_Db_Select::GROUP);
        $countSelect->columns("COUNT(DISTINCT ".implode(", ", $group).")");
    } else {
        $countSelect->columns('COUNT(*)');
    }
    return $countSelect;
}
}

Why Im getting Declaration of overridden method should be compatible with parent class error.

How to fix it?


texts: Magento 2: Content blocks with same identifier (e.g. "contact-us-info") not shown in second Store View. Why doesn't it work like with content pages?

texts:
I am beginner and testing Magento 2.0.1 with the Luma template to setup a dual language shop. I have created a second Store view for the second language (German) but new blocks with same identifiers are simply not shown. I have followed the same approach as when creating new content pages earlier, which worked well and as expected. But not so for the content blocks e.g. "contact-us-info" or "footer-links-block" :-(

These are my steps:

Limit the Store View of an existing block, e.g. "contact-us-info" to the "Default Store View" (English)
Copy the contents of that block and create a new block with the same identifier for the second Store View (German). However, the block is simply not shown in the frontend after I switch to the second Store View in the frontend.

More puzzling: Even if I change the identifier e.g. from "contact-us-info" to "contact-Blabla__" the block is still shown as before! It appears the block identifier is not actually used at all (hard-linked?).

Question: How can I create a second (translated) contents block for a different Store View? What am I missing?? Could somebody please be so kind to drop me a hint what I am doing wrong?


texts: Duplicate "Price as configured" block on bundle products

texts:
I'd like to have the price as configured block visible both on top & on bottom (as it currently is) for the bundle product page:

Looking through app/design/frontend/base/default/template/ I can see that this is populated by the following files:

bundle/catalog/product/view/type/bundle.phtml on line 45:

<?php echo $this->getChildHtml('bundle_prices') ?>

And catalog/product/view/options/wrapper/bottom.phtml on line 27:

<div class="product-options-bottom">
    <?php echo $this->getChildHtml('', true, true);?>
</div>

The first one seemingly responsible for the population of the numeric pricing value based on option selection, whereas the second one is responsible for generating the block in it's entirety.

Unfortunately, the call $this->getChildHtml('', true, true); doesn't point me in much direction with regards to what to lookout for in the layout file.

Would really appreciate any pointer as to how I could get that block (& accompanying JS) duplicated on top (prior to the options)  instead of just below. This way the customer can see pricing without having to scroll through all the options (if there is a default configuration selected).

Like this:


texts: Using Magento 2 Rest API To Filter On Enabled Products in a Certain Category

texts:
I'm having some issues using Magento 2 Rest API to filter on products in a certain category that are enabled.
Right now I just get products in a category but the ones that are disabled or not visible are messing with counts and other problems so I only want to show enabled ones.
I came up with the following search query that doesn't seem to work good:
$ch = curl_init($magentoServerUrl . "/rest/V1/products?searchCriteria[filter_groups][0][filters][1][field]=status&searchCriteria[filter_groups][0][filters][1][value]=1&searchCriteria[filter_groups][0][filters]1][condition_type]=eq&searchCriteria[filterGroups][0][filters][0][field]=category_id& searchCriteria[filterGroups][0][filters][0][value]=" . $categoryId . "&searchCriteria[filterGroups][0][filters][0][conditionType]=eq&searchCriteria[sortOrders][0][field]=created_at&searchCriteria[sortOrders][0][direction]=DESC&searchCriteria[pageSize]=" . $numGet . "&searchCriteria[currentPage]=" . $currentPage);
But this shows products from all categories. What am I doing wrong here?
Status = [filter_groups][0][filters][1]
Category = [filterGroups][0][filters][0]
Is the ordering of the filters important? Or do I have to do something else to have multiple filters?
How would I fix the above query to:

Get only products in a certain category.
Get only products that are enabled.
Sort by date created/updatd.
Get only a certain number of them.

Thanks!!


texts:
I want use below query in my custom module

SELECT category_name
FROM faq_category
WHERE id = ANY (SELECT category_name FROM faq_category_description WHERE category_name = 1);

But i don't know syntax of query in magento2 ?If anyone knows please explain me....


texts:
Is there any reason that in Magento 2 we don't have Duty as additional totals row?

We would like to start an e-commerce store which will ship goods to all countries around the world. It means we will need to calculate taxes and duties.

For taxes, we have all admin management tools, where we can define tax rates, tax rules etc. but for duties there is nothing.

Maybe there is a different way to configure duties in Magento 2? I will appreciate your answers and user cases how you have solved it in your projects.

Thanks in advance


texts: How to change default language in magento 1.9.0.1

texts:
I manage to create 2 language storeview. For example 1 is english and 1 is spanish. (for english the code is "english" and for spanish the code is "spanish"
I want to make everybody who enter my site go to my spanish language.
I already change the sort order the spanish to 0, and english to 1.
But whenever I open the site it still go to english not spanish.
How to make everyone to go to spanish when first open my website?


texts: $_File array empty in Magento 2 while Uploading file at admin form

texts:
I am working on admin form in which i am trying to upload the file but it is giving me the $_File array is empty which means i am not getting file. Following is my code in form.

  $fieldset->addField(
        'file',
        'file',
         array(
                'name' => 'file',
                'label' => __('File'),
                'title' => __('File')
            )
        );

Here is code of my controller

public function __construct(
        Context $context,
        \Magento\Framework\Filesystem $filesystem,
        \Magento\MediaStorage\Model\File\UploaderFactory $fileUploaderFactory
    ) {
        $this->_mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA);
        $this->_fileUploaderFactory = $fileUploaderFactory;
        parent::__construct($context);
    }
    public function execute()
    {
        /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
        try{
            $target = $this->_mediaDirectory->getAbsolutePath('mycustomfolder/');
            /** @var $uploader \Magento\MediaStorage\Model\File\Uploader */
            $uploader = $this->_fileUploaderFactory->create(['fileId' => 'file']);
            /** Allowed extension types */
            $uploader->setAllowedExtensions(['jpg', 'jpeg', 'gif', 'png', 'zip', 'doc']);
            /** rename file name if already exists */
            $uploader->setAllowRenameFiles(true);
            /** upload file in folder "mycustomfolder" */
            $result = $uploader->save($target);
            if ($result['file']) {
                $this->messageManager->addSuccess(__('File has been successfully uploaded'));
            }
        } catch (\Exception $e) {
            $this->messageManager->addError($e->getMessage());
        }
        return $this->resultRedirectFactory->create()->setPath(
            '*/*/upload', ['_secure'=>$this->getRequest()->isSecure()]
        );
    }


texts: depedency for magento configuration in magento2

texts:
I have tried to set dependency for configuration setting of magento 2 but not able to set.
So, How can I put dependency in system.xml file in magento2 for configuration?


texts: Magento Attribute with the same code already exists

texts:
I am trying to get a new Magento 2.1 store configured, but I have an issue when I try to save the Customer Configuration, where I get the warning: Attribute with the same code already exists.

I thought it was to do with a specific attribute I was changing to start with, but I get the same error without making any changes and just hitting Save on this admin page. No other pages cause me this issue.

How do I find out which attributes are causing the problem here? And how do I resolve the issue?

I'm guessing that something is a little messed up from the data import migration from my Magento 1.9 store, but I had no part of that migration, so not sure where to start checking for issues?

I see nothing helpful in any of the log files to point me to a solution.


texts: Magento 2 SOAP import makes ugly urls. How can I fix it?

texts:
An external system is making requests to /soap/all?services=catalogProductRepositoryV1. Products are imported. So far so good.
But the url key is encoded in an ugly way.
<attributeCode>url_key</attributeCode>
<value>Test Product (Example)</value>
</item>

Becomes Test%20Product%20%28Example%29
I would like it to be more like:
test-product-example
Should be an easy fix. But I cannot find the code where all this is handled?
Questions:

Is there an easy way to manage this? Maybe a configuration option or something?
Where is the module/code responsible to handle the save of an url_key attribute from a SOAP request?
What is the best way to capture and replace the behavior? Writing a custom plugin maybe?


texts: Magento 2 disable/remove Cart button from configurable product for Out of Stock Options

texts:
I am using Magento 2.1 and I found that for configurable products, if any variation of associated product is out of stock, then add to cart button is still visible.
I want to hide/disable it when selected simple product is not in stock so that user knows that the product is not in stock.Currently, Add to cart button is visible for all product options and when I click on Add to cart, it shows me error message that the product is not in stock. Please guide how can I achieve this.


texts: Encryption Method Used by Magento Enterprise

texts: What encryption method is used by Magento Enterprise to save sensitive data (customer passwords etc)


texts: Magento refusing to use APC for opcode cache (no system cache entries)

texts:
I have inherited a Magento site (v 1.9.0.1), now running on my VPS.  I use APC for all php sites on the server, with no problems.  Like my other php sites, I expected to see entries in the System cache for my Magento site, but there are none.

I have tried adding the following to my local.xml file:

   <cache>
       <backend>apc</backend>
       <prefix>CIB_</prefix>
   </cache>

With this setting, I do see entries in the APC User cache.  However, APC should work as opcode cache, no matter what cache is specified in local.xml.  Is this correct, or is there some special about Magento that would cause it not to use the opcode cache?

Below is my APC config.  I realise that "cache_by_default" is set to 0 - I add "php_flag apc.cache_by_default On" to the VirtualHost settings for sites where I want to use apc, including this one.

Thanks in advance for any assistance.


texts: Is there an EPOS solution out there that integrates with a magento 2 website and supports omnichannel gift card integration

texts:
The fashion retailer I work for is looking for a more suitable EPOS system to integrate with our Magento 2 website.
The biggest issue we are facing when trying to find the best solution is that no one seems to be able to offer an omnichannel gift card integration.
When I say "omnichannel gift card integration" I mean we would like to sell gift cards in-store and online and redeem the vouchers in-store and online regardless of if its an online gift card or in-store gift card.
Any experience or advise with this would be a great help.
Thanks


texts: Create conditions for coupon rule in Magento 2

texts:
I'm trying to create conditions in the coupon rules, but when creating the conditions they are not aggregated correctly

Im doing:

        $rule = $this->couponRule;

        $cond['conditions']['1']['type']= 'Magento\SalesRule\Model\Rule\Condition\Combine';
        $cond['conditions']['1']['new_child']= '';
        $cond['conditions']['1']['aggregator']= 'all';
        $cond['conditions']['1']['value']= 1;
        $cond['conditions']['1--1']['type']= 'Magento\SalesRule\Model\Rule\Condition\Product\Found';
        $cond['conditions']['1--1']['new_child']= '';
        $cond['conditions']['1--1']['value']= 1;
        $cond['conditions']['1--1']['aggregator']= 'all';
        $cond['conditions']['1--1--1']['type']= 'Magento\SalesRule\Model\Rule\Condition\Product';
        $cond['conditions']['1--1--1']['attribute']= 'category_ids';
        $cond['conditions']['1--1--1']['attribute_scope']= 'parent';
        $cond['conditions']['1--1--1']['operator']= '!{}';
        $cond['conditions']['1--1--1']['value']= 10;

        try {
            $rule->setName('Cupom Dinâmico')
                ->setDescription('Criado dinamicamente')
                ->setUsesPerCustomer(1)
                ->setUsesPerCoupon(1)
                ->setIsActive(1)
                ->setSimpleAction('by_percent')
                ->setDiscountAmount($discount_amount)
                ->setDiscountQty(1)
                ->setApplyToShipping('no')
                ->setTimesUsed(1)
                ->setCouponType(2)
                ->setCustomerGroupIds('0,1,2,3')
                ->setWebsiteIds('1,2,4')
                ->setConditionsSerialized($this->serializer->serialize($cond))
                ->setCouponCode($coupon_code);

            $rule->save();
            return [
                'error' => false,
                'coupon_code' => $coupon_code,
                'discount_amount' => $discount_amount
            ];

        } catch (\Exception $e){
            return false;
        }

As the rule is being displayed:

How it should be:


texts: is it possible to install magento on iis server?

texts: we are trying to migrate an existing Magento website to our server is it possible to install Magento on windows IIS web server?


texts: How to get the custom order attributes in default order Api response in magento 2.3

texts:
I have created a new custom order attribute named delivery_date and shown the same in sales order grid but i am not getting the custom attribute in my order Api response.

The error I am getting is Fatal error: Uncaught Error: Call to undefined method

Magento\Sales\Api\Data\OrderExtension::setTipAndTrickAttribute()

Please help.

  app/code/Amos/CustomOrder/etc/di.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
        <arguments>
            <argument name="columns" xsi:type="array">
                <item name="delivery_date" xsi:type="string">sales_order.delivery_date</item>
                <item name="no_of_days" xsi:type="string">sales_order.no_of_days</item>
                <item name="no_of_crew" xsi:type="string">sales_order.no_of_crew</item>
            </argument>
        </arguments>
    </virtualType>
</config>

  app/code/Amos/CustomOrder/etc/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="sales_order_load_after">
    <observer name="sales_order_load_delivery_date" instance="Magestore\TipAndTrick\Observer\Sales\OrderLoadAfter" />
</event>
</config>

  Amos/CustomOrder/etc/extension_attributes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
    <attribute code="delivery_date" type="string" />
</extension_attributes>
</config>

  Amos/CustomOrder/Observer/Sales/OrderLoadAfter.php

<?php
namespace Amos\CustomOrder\Observer\Sales;
use Magento\Framework\Event\ObserverInterface;
class OrderLoadAfter implements ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
    $order = $observer->getOrder();
    $extensionAttributes = $order->getExtensionAttributes();
    if ($extensionAttributes === null) {
        $extensionAttributes = $this->getOrderExtensionDependency();
    }
    $attr = $order->getData('delivery_date');
    $extensionAttributes->setTipAndTrickAttribute($attr);
    $order->setExtensionAttributes($extensionAttributes);
}
private function getOrderExtensionDependency()
{
    $orderExtension = \Magento\Framework\App\ObjectManager::getInstance()->get(
        '\Magento\Sales\Api\Data\OrderExtension'
    );
    return $orderExtension;
}
}


texts:
I am new with Magento, I found that it's realy hard to do even for doing trivial thing.

I just try to follow this article https://www.mageplaza.com/magento-2-module-development/view-block-layout-template-magento-2.html but the block seems does not loaded.

Here is my routes.xml

Here is my controller

Here is my layout

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
        <block class="Mageplaza\HelloWorld\Block\Display" name="helloworld_display" template="Mageplaza_HelloWorld::sayhello.phtml" />
    </referenceContainer>
</page>

Here is my phtml

This is my browser view

I have tried this in my Block but nothing was happened.


texts: MSP Recaptcha issue with changing contact page title

texts:
I have tried to change the title of the contact us page to just Contact, i did this by copying the contact xml file to my local theme

  /Magento_Contact/layout/contact_index_index.xml

and then updated

<head>
    <title>Contact</title>
</head>

Why does this break msp/recaptcha module

  Magento Version 2.3.3

  error message Incorrect Captcha
  thanks


texts: How can pass default value for a textarea on UI Form component Magento 2?

texts:
Is there a way to supply a dynamic default value for textarea field on a UI form?

I have a situation where the default value may change. In this case I was thinking the value could be stored in a file that could be updated by hand when needed. I would then use a class to retrieve the file contents to use as the default value of textarea field when a new record is shown. If the value was updated it would need to be saved and the updated value shown when editing the record.

Thoughts on how to handle this requirement?


texts: knockout template html file in adminhtml area is not rendering

texts:
I am trying to initialize the knockout component in the admin html area, the respective code is below.

  phtml file to initialize ko template

<?php
/**
 * @var \JC\ChatSupport\Block\Adminhtml\ChatList $block
 */
?>

    phtml

  js component file

define([
        'jquery',
        'uiComponent',
        'ko'
    ], function ($, Component, ko) {
        'use strict';

    return Component.extend({
        initialize: function () {
            this._super();
            console.log("hello, this is loading");
        },
    });
    }
);

  html template file

    Here this content is not loading

Here my problem is the content in html template file is not rendering in the page.


texts: How to create Delete function in My Order page

texts:
I want to add a new action in My Orders page that is Delete action

How can I do that? Can anyone help me with this function?


texts: where should I get format of request body of REST api - Magento 2

texts:
I'm trying to create simple product using magento REST api. I have tried this link, it works but I need to know full options of create product like media gallery entries,product links,...etc.

So I need to know what is full formats of request body of rest api for create product.

I'm looking similar to this link they can mention full options, it seems more friendly to interact with rest api.


texts: Magento 2.2.5: How to get product id after product saved using plugin

texts:
I'm looking for how to get product id after product saved using plugin.
I use the plugin to catch after execute() is fired.
But I can't get product id no matter how I try.
Here is what I've done:

  di.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Controller\Adminhtml\Product\Save">
        <plugin name="synergy_butility_save_product"
                type="Synergy\Butility\Plugin\Product\Save"
        />
    </type>
</config>

  Save.php

<?php

namespace Synergy\Butility\Plugin\Product;

class Save
{
    public function __construct(
        \Magento\Framework\App\RequestInterface $request
    )
    {
        $this->_request = $request;
    }

    public function afterExecute(\Magento\Catalog\Controller\Adminhtml\Product\Save $subject, $result)
    {
        // AB-18 -fudu- update news_to_day take data from news_to_date in catalog_product_flat_32 table after "saved product" in admin page
        $productId = $subject->productId;

        $post = $this->_request->getPost();
        var_dump($post); exit;
        // $news_to_date = $subject->getProduct()->getNewsToDate();

        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $resource = $objectManager->get('\Magento\Framework\App\ResourceConnection');
        $connection = $resource->getConnection();
        $tableName = $resource->getTableName('catalog_product_flat_32');

        $query = "SELECT * FROM " . $tableName . " WHERE entity_id = " . $productId;

        $product = $connection->query($query);

        foreach ($product as $rows) {
            var_dump($rows);
        }
        var_dump('doesnt work');
        exit;
        $update_to_db = "UPDATE " . $tableName . " SET news_to_day = '" . $news_to_date . "'  WHERE entity_id = " . $productId;
        $connection->query($update_to_db);
    }
}

Thanks for reading :)


texts:
My question is maybe quite simple to answer: We are about to deploy Magento CE on a server that will be dedicated to gather the companies located in Panama Zona Libre de Colon. There are approximately 2000 companies. What we want to accomplish is a site like Amazon, but where the companies will be in charge to list their own products under the supervision of my company, meaning that they will need access to upload product details and pictures to their own "store", we will get paid using our payments gateway and once a week we are paying the suppliers after charging our fees.

Would it be possible something like that? is so, could somebody point me in the right direction?

This is what I have done already www dot zonalibredecolon247 dot com it's an unfinished example site for our customers


texts:
I have tier pricing on my custom shirts, but the tier pricing only works when you select the same size for all shirts, or in my case select a least 2 shirts in the same size.

My tier pricing is like this:

Price for 1 shirt is 200

Price pr shirt for 2-5 is 175

If the costumer chooses 3 medium the price is 525 (175 pr shirt)
If the costumer chooses 2 small and 2 medium the price is 700 (145 pr shirt)
But if the costumer chooses 1 small and 2 medium the price is 550 (175 for the mediums and 200 for the small)

Is there any way of combining sizes and still recieve the discount, so the costumer doesn't have to buy at least two of each size?


texts: export only customers and orders tables data from one magento 2 db to another

texts:
Hi I recently migrated all customers and orders from M1(EE) to M2(EE) but here what i want to do export only customers and order tables to import into another db.
Can any one give me advice on this.Thanks.


texts: Out of Stock Products Displaying on front-end when told not to!

texts:
just a quick one. Using Magento 2.3.2
I have "Display out of stock products" switched to "No" in Stores > Configuration > Catalog > Inventory, but my storefront still displays all the O.O.S. products. I have cleared caches, flushed caches, re-indexed, re-deployed, but still, there they are. I would like them to go away now. Does anyone have any suggestions? Thank you.


texts: Check if coupon code is valid by using customer id and product id

texts: How to check if a coupon code is valid if i only have customer id and product id data? and how to get this coupon sales-rule data?


texts: How to get product video in product listing page in magento 2?

texts: How to get product video as base and thumbnail in product listing page. Currently, Only Video preview image is showing in listing page. But I want to display video in listing page instead of the preview image.


texts: when apply SUPEE-6788 my home page goes blank

texts:
When I apply PATCH_SUPEE-6788_CE_1.9.0.0_v1-2015-10-26-11-59-04.sh
in my magento 1.9.0.0 my home page goes blank.

My 1column.phtml shows on frontend:

when I reverse apply the patch, the website shows back.


texts: Alternate method of getting product_id without using registry()

texts:
How to get the current product id.

I don't want to get the product information from id (I want to get only the current id dynamically, not by assigning some value and get through object manager).

Currently I have used something like:

Event.xml

<event name="catalog_product_delete_after">
    <observer name="catalog_product_delete_after_handler" instance="Vendor\Module\Observer\SyncProductDeleteObserver"/>
</event>

Observer:

public function execute(EventObserver $observer)
{
    $productdel = $observer->getEvent()->getProduct();
    $this->productDelete($productdel);
    return $this;

}

public function productDelete($productdel)
{
    $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
    $productdel = $objectManager->get('Magento\Framework\Registry')->registry('current_product');
    $productid=$productdel->getEntityId();
  ....

ERROR:

I get getEntityid() on null during product delete.

I want to use an alternative to registry().

Please provide any other method?


texts: How to use responsive.js in a theme derived from Luma?

texts:
The Magento DevDocs says

  You can use the menu.js, responsive.js and matchMedia.js to add
  responsive behavior in your custom theme. If your theme inherits from
  Blank or Luma, you do not even need to additionally include the script
  files in your theme.

But what does this actually mean in practice? I need to alter some css classes/onclick behaviour based on the media query, but if I don't even need to additionally include the script files in my theme, how does it work?


texts:
Date of Birth is not displaying in magento2 sales order create form in admin magento2.
Even settings are enable for admin checkout.


texts: How to remove edit and delete button from minicart?

texts:
I tried,

vendor\magento\module-checkout\view\frontend\web\template\minicart\item\default.html

I removed below lines

But still there is no effect. Can anyone tell me the correct way to do?


texts:
i want to add custom sidebar to category via custom design. i added below code but it is not working

config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Abc_Design>
      <version>0.1.0</version>
    </Abc_Design>
  </modules>
  <global>
    <helpers>
      <design>
        <class>Abc_Design_Helper</class>
      </design>
    </helpers>
  </global>
</config>

in admin category > custom design

   <reference name="left">
        <block type="abc/design" name="new_block_name" template="smartwave/porto/template/design.phtml" after="adjacent_block_name" />
    </reference>


texts: Add a specific fee to the payment in Magento 2.3

texts:
When I'm working with magento2.1 I use

Boolfly Payment Fee extention for adding specific fee to the payment.
Link : https://github.com/mrkhoa99/Boolfly_payment_fee

but now I'm working with magento2.3.
This extension is not working in magento2.3.
Please suggest any free extensions for this.


texts:
I have layout

    <block class="Magento\Framework\View\Element\Template" name="header"
          template="Vendor_Module::header/notice.phtml" before="-"/>

In my template I do the following :

echo get_class($block); // Magento\Framework\View\Element\Template

echo get_class($this); // Magento\Framework\View\TemplateEngine\Php

$block - indicates my block defined in the layout

Why do I need $this ?


texts: entity_type_code_entity table is empty in magento2

texts:
I am trying to insert data into the EAV tables, but my main entity table isn't saving any data but the value tables data is inserted.
My Entity Type code is vinay_employee, my table vinay_employee_entity has three columns entity_id employee_name and employee_email. Data is not inserting into vinay_employee_entity when i am calling save() function but other values tables like vinay_employee_entity_datetime get their data.
Model/EmployeeData.php
namespace Vinay\Employee\Model;

use Magento\Framework\DataObject\IdentityInterface;
use Magento\Framework\Pricing\SaleableInterface;
use Vinay\Employee\Api\Data\EmployeeInterface;
use Magento\Framework\Api\AttributeValueFactory;

class EmployeeData extends \Magento\Framework\Model\AbstractModel{

    const ENTITY = "vinay_employee";

    protected function _construct() {
        $this->_init('Vinay\Employee\Model\ResourceModel\EmployeeData');
    }
}

ResourceModel/EmployeeData.php
namespace Vinay\Employee\Model\ResourceModel;

class EmployeeData extends \Magento\Eav\Model\Entity\AbstractEntity{

    protected function _construct()
    {
        $this->_read = 'vinay_employee_read';
        $this->_write = 'vinay_employee_write';
    }

    public function getEntityType() {
        if(empty($this->_type)) {
            $this->setType(\Vinay\Employee\Model\EmployeeData::ENTITY);
        }

        return parent::getEntityType();
    }
}

Controller/Adminhtml/Emp/Save.php
namespace Vinay\Employee\Controller\Adminhtml\Emp;

class Save extends \Vinay\Employee\Controller\Adminhtml\Emp\AbstractAction {

    //put your code here

    private $connection;
    private $employeeDataFactory;
    private $employee, $employeeDataFactoryResource, $registry;

    public function __construct(
            \Magento\Backend\App\Action\Context $context,
            \Magento\Framework\Registry $registry,
            \Magento\Framework\App\ResourceConnection $resourceConnection,
            \Vinay\Employee\Model\ResourceModel\EmployeeDataFactory $employeeDataFactoryResource,
            \Vinay\Employee\Model\EmployeeDataFactory $employeeDataFactory) {
        $this->connection = $resourceConnection->getConnection();
        parent::__construct($context);
        $this->employee = $employeeDataFactory;
        $this->registry= $registry;
        $this->employeeDataFactoryResource = $employeeDataFactoryResource;
    }

    public function execute() {
        $postObj = $this->getRequest()->getPostValue();
        echo "<pre>";
        $employeeModel = $this->employee->create(["employee_name", "employee_email"]);
        $result = $employeeModel->setData($postObj)->save();
        print_r($result->getData());
        die();
        $this->employeeDataFactoryResource->create()->save($employeeModel);
        return $this->_redirect("employee/emp/index");
    }
}

$result
Array
(
    [form_key] => HSR4TCVPyzs6r6Wi
    [employee_name] => vinn
    [employee_email] => viin
    [employee_address] => ddsdds
    [is_permanent] => 0
    [joined_at] => 2021-04-15 10:02:35
    [vinaykharayat11] => ssdsd
    [parent_id] => 0
    [created_at] => 2021-04-15 04:32:37
    [updated_at] => 2021-04-15 04:32:37
    [entity_id] => 37
)


texts: Where i can edit the store label in admin magento 2

texts:
I am trying to edit store info and want them on in one line only.In sales_order_grid.xml
http://prntscr.com/qlsnho


texts: Auto complete all orders within magento 2

texts:
I need to auto invoice/ship/complete all orders within our store. This is an internal store and we do not require payment however products DO have a price.

Is there a method to auto complete these orders?


texts: Add email field to Review Form - Magento 2

texts:
Working with Magento 2.1. I've hit a bit of a bump in adding a field to the review form.

These are the only requirements. An email address field added to the review form. Once the review is submitted, the email address is saved with the review. The email address is displayed ONLY with the review on the admin. Reviews can be searched in the admin by email address.

I found this question: Adding custom fields to review form  but is Magento 1 and seems to go off on attaching the email to an order(?).

I listed all of the requirements, but I can't expect anyone to address each of them. I understand that, but I'm at a bit of a loss, and appreciate any help that can be given.


texts: sender address must contain a domain in While Sent NewsLetter magento 2

texts:
I am working with Newsletter in Magento 2.

I have follow this link http://blog.belvg.com/newsletters-in-magento-2-0.html to Configure NewsLetter in Magento 2.

After Queueing Newsletter, admin side changes status "Not Sent" to Sent.

But, throws an error in CustomerSupport: sender address must contain a domain

In newsletter_problem table and Report-> NewsLetter Problem in admin side.

But, All the Mail function working fine like subscription mail, new account mail.

Suggest me why this problem occur and how to solve this.


texts:
I got multiple Domains for different countries like:
www.domain.de
www.domain.be

Now i want to setup another Website within my Magento installation where www.domain.de is already setup and linked to a website and link the www.domain.be Domain to a new created Website to create a Shop for belgium.

Things I've already done:
• Create a new Website
• Create a Shop for that Website
• Create Storeviews for that Shop
• Configure the Base-URLS on the belgium Website

• Belgium -> Belgium Shop -> dutch / french

When i try to access the www.null-bar.be Domain i do not get the right Website ( in fact i get the default screen from my hosting provider ) - The directory is set on the server-configuration.

I saw that i have to change things in the index.php to actually link the other domain to the right Website but none of the articles i've read was clear to understand...

Could anyone link a cleary understandable "tutorial" or article where i can make my stuff possible ?


texts:
Installed Magento CE 1.6/7/8/9 + sample datas on my dev server

when editing a product in back office, in "custom options" tab, "+ add new option" does not do anything and no JS error logged...

did not find solution in official Magento forums (currently under maintenance)

tried to read official doc about custom options but Google + Magento doc internal search module (I guess it uses Google too) sends me too doc home page, can't access indexed pages.


texts: Magento 2, website redirecting to localhost

texts:
I uploaded my magento 2 website from localhost (xampp) to server.

I changed base url in database table but it is still redirecting to same localhost (both section frontend and admin).

Is there a problem with the cache? If yes, then how do I clear the cache on server?


texts: Develop extension for magento go platform

texts: i am googling for last 2 hours but can not find any proper documentation about creating extension for magento go. can any one let me know how can i develop, submit and install an extension on magento go?


texts: Magento2: Bundle product not displaying in category page and don't search

texts: I clean cash and reindex.But it doesn't work for me.Please help me,thanks.


texts: How to hide the categories which has no product from topmenu in Magento2

texts:
How to hide the sub-categories if they don't have any product?

I have already checked github.com/code-x/magento2-hide-empty-categories but it hides the parent category as well even the child category have products.

I don't want to hide the child categories which have products.


texts:
I am getting an error while trying to pragmatically remove products from some categories.

Error:

  Fatal error: Uncaught TypeError: Argument 3 passed to
  Mage_Catalog_Model_Resource_Abstract::_canUpdateAttribute() must be of
  the type array, null given, called in
  /xxx/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php on
  line 1225 and defined in
  /xxx/public_html/app/code/core/Mage/Catalog/Model/Resource/Abstract.php:540

  Stack trace:
  #0 /xxx/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1225):
  Mage_Catalog_Model_Resource_Abstract->_canUpdateAttribute(Object(Mage_Catalog_Model_Resource_Eav_Attribute), '2019-01-14 00:0...', NULL)

  #1 /xxx/public_html/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1123):
  Mage_Eav_Model_Entity_Abstract->_collectSaveData(Object(Mage_Catalog_Model_Product))

  #2 /xxx/public_html/app/code/core/Mage/Core/Model/Abstract.php(318): Mage_Eav_Model_Entity_Abstract->save(Object(Mage_Catalog_Model_Product))

  #3 /home/admin/domains/gr in /xxx/public_html/app/code/core/Mage/Catalog/Model/Resource/Abstract.php
  on line 540

And my code:

$products = Mage::getModel('catalog/category')->setStoreId($storeId)->load($specialCategoryId)
    ->getProductCollection()
    ->addAttributeToSelect(array('special_to_date', 'category_ids'))
    ->addAttributeToFilter('special_to_date', array('lteq' => date("Y-m-d")));

foreach ($products as $product) {

    $oldCategories = $product->getCategoryIds();
    $newCategories = array_diff($oldCategories, $specialCategoryIds);

    if($oldCategories != $newCategories){
        $_product = Mage::getModel('catalog/product')->load($product->getEntityId());

        $_product->setCategoryIds($newCategories);

        Mage::log('Product ID: ' .$product->getEntityId(), null, 'RemoveFromCategoryLog.log', true);
        try {
            $_product->save();
        } catch(Exception  $e){
            Mage::log($e->getMessage(), null, 'RemoveFromCategoryLog.log', true);
        }
    }
}

Loading the product did not solve it. And as there are lots of products i am reluctant to use category_api.


texts: How do I apply a discount to products in a category?

texts:
Im trying to set up a rule for my magento products but having some issues, the rules I want o apply are:

If the products are in the category id 3 apply the discount,
If I have 2 items in category 3 and 1 item from a different category apply the discount only to the items in category 3,

If 2 items are the same from category 3 apply the discount.
If 2 items are different but still from the same category apply the discount.
If other items not matching these parameter only apply the discount to the items in the category.


texts: what is the path of block/template from where images are being shown in mini cart?

texts:
In my modules minicart this is code outputting images and remove, etc buttons.

 <?php foreach($_items as $_item): ?>
 <?php echo $this->getItemHtml($_item) ?>
 <?php endforeach; ?>

Corresponding block is Mage_Checkout_Block_Cart_Sidebar and helper $this->helper('ultimo');. But I don't see getItemHtml() function present either in block file or the helper file. What is the exact path from where actual image is being outputted?


texts:
for a plugin we generate an XML output which works on several systems without a problem. One system though adds extra content.

In the related controller we do have the following lines:

$this->getResponse()->setHeader('Content-Type', 'text/xml; charset=utf-8');
$somevars= array('protocol'=>$protocol,'server_name'=> $_SERVER['SERVER_NAME']);
$this->loadLayout()->getLayout()->getBlock('root')->setTemplate('foo/bar.xml.phtml')->setData('somevars',$somevars);

As said, this works on several systems but not on every system it seems.
My question now is, what can we do to prevent magento from adding and/or rendering any other content except the content added via the above lines.

I tried unsetBlock, createClock, addBlock, but still seem to have some issues understanding the concept or the correct order.

Any help is appreciated.


texts: Magento layered navigation filtering URL's with name not id

texts:
I have a quick question that is effecting the usability of my site. I've added some custom attributes to my layered navigation, and all works find. apart from one tiny little issue. I would ideally like the URL that's built to say "brand=name" where as currently the ID of the brand is being passed instead.

Is there a way to change this so that the custom attributes name is passed to the url for filtering instead of the id?


texts: Can anyone explain frontend_model in system.xml file?

texts:
Can anyone explain frontend_model in system.xml file.

                            Update Lowest Quality Price
                            button
                            productprice/adminhtml_system_config_form_button
                            22
                            1
                            1
                            1


texts: Magento 2 Filter product collection by multiple attributes with OR

texts:
In Magento 2.3.3, How Can I Filter Product Collection by Multiple Attributes? First attribute SKU needs to check using "IN" second attribute is yes/no value. I need to filter collection by SKU array OR custom_attribute. I have tried few things but it did not return expected results.

$collection = $layer->getProductCollection()->addAttributeToFilter(
    array(
        array("attribute"=>"sku",array('in' => $skus)),
        array("attribute"=>"universal_fitment","eq"=>1)
    )
);


texts:
I'm trying to update a custom customer attribute (required = false) but i am having difficulty solving the problem as my developer skills are limited..

I created a custom module/attribute using: http://www.silksoftware.com/magento-module-creator/ which i uploaded and deployed into my magento root folder.

The field now appears on the back end, however I made the mistake of installing the module as required = true. I'm trying to update this to required = false or is_required = 0

<?php

$installer = $this;

$installer->startSetup();
$installer->updateAttribute('customer', 'business_name', 'required', false);
$installer->updateAttribute('customer', 'business_abn', 'required', false);
$installer->endSetup();

I've also tried 'is_required' 0 and haven't noticed any change after flushing cacches

This is my config file

<?xml version="1.0"?>
<config>
  <modules>
    <SAS_BusinessInfo>
      <version>0.1.0</version>
    </SAS_BusinessInfo>
  </modules>
  <global>
    <helpers>
      <businessinfo>
        <class>SAS_BusinessInfo_Helper</class>
      </businessinfo>
    </helpers>
    <models>
      <businessinfo>
        <class>SAS_BusinessInfo_Model</class>
        <resourceModel>businessinfo_mysql4</resourceModel>
      </businessinfo>
    </models>
    <resources>
      <customerattribute1438050443_setup>
        <setup>
          <module>SAS_BusinessInfo</module>
          <class>Mage_Customer_Model_Entity_Setup</class>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </customerattribute1438050443_setup>
      <customerattribute1438050443_write>
        <connection>
          <use>core_write</use>
        </connection>
      </customerattribute1438050443_write>
      <customerattribute1438050443_read>
        <connection>
          <use>core_read</use>
        </connection>
      </customerattribute1438050443_read>
    </resources>
  </global>
</config>

Am i missing anything in my update or config file?

Is the update php file meant to be uploaded to the same folder as the install php file? the magento root folder?

is my config file calling on my update php file correctly?

The install file is named mysql4-install-0.1.0.php , does the update.php filename matter?


texts: magento generate coupon code not working after apply SUPEE-11155

texts:
Generating coupon code when a subscriber subscribes to the newsletter it's working fine before applying SUPEE-11155 but after applied SUPEE-11155 not working.

  Magento version 1.9.4.0

$model = Mage::getModel('salesrule/rule');
$model->load(301);
$massGenerator = $model->getCouponMassGenerator();
$session = Mage::getSingleton('core/session');
$ruleId = Mage::getStoreConfig(301);
if (!is_numeric($ruleId)) {
    return self::ERROR_SHOPPING_CARD_RULE_IS_MISSING;
}

$rule = Mage::getModel('salesrule/rule')->load($ruleId);
if (!$rule->getId()) {
    return self::ERROR_SHOPPING_CARD_RULE_IS_MISSING;
}

try {
    $massGenerator->setData(
        array(
            'rule_id' => $ruleId,
            'qty' => 1,
            'length' => Mage::getStoreConfig('newsletter/coupon/length'),
            'format' => Mage::getStoreConfig('newsletter/coupon/format'),
            'prefix' => Mage::getStoreConfig('newsletter/coupon/prefix'),
            'suffix' => Mage::getStoreConfig('newsletter/coupon/suffix'),
            'dash' => Mage::getStoreConfig('newsletter/coupon/dash'),
            'uses_per_coupon' => 1,
            'uses_per_customer' => 1
        )
    );
    $massGenerator->generatePool();
    $latestCuopon = max($model->getCoupons());
} catch (Mage_Core_Exception $e) {
    $session->addException($e, $this->__('There was a problem with coupon: %s', $e->getMessage()));
} catch (Exception $e) {
    $session->addException($e, $this->__('There was a problem with coupon.'));
}

Below is exception.log

[0] => There was a problem with coupon: %s
[1] => Disallowed template variable method.


texts: How can I get configurable product from a sales order?

texts:
I've created a button in the back end of my Magento 1.9 website called "Send to Printers" that I need to send JSON data to my printers API. I'm able to get some of the order information using the following:

$orderID = $this->getRequest()->getParam('order_id');
$order = Mage::getModel("sales/order")->load($orderID);
$customer = $order->getShippingAddress()->getData();

Unfortunately though the following code isn't allowing me to get information about the items of that order:

$orderItems = $order->getAllItems();
foreach ($orderItems as $itemId => $item) {
  if ($item->getParentItem()) {
    // This is a simple product assigned to a configurable
    // You can get every single details by loading it
    $product = Mage::getModel('catalog/product');
    $product->load($item->getSku(),'sku');
    // This variable will store all the data
    $data = $product->getData();
} else if ($item->getHasChildren()) {
    // This is a configurable product
}
}

The foreach never reaches any of the if statements. What am I doing wrong?


texts:
Magento 1.9.x comes with a /dev/ folder (not meant to land in production!) containing many unit tests based on phpunit.

How can I use these tests and how to implement my own?


texts: Magento 2: Add category dropdown attribute to product

texts:
Is it at all possible to add a category dropdown attribute to a product? I need to somehow select a primary category when adding/editing products. I've seen suggestions to paste in the category's ID, however, this isn't ideal for our site administrators and a simple dropdown would be much more user-friendly.

I've created the custom attribute as a text field (same as category_ids) but I was wondering if there was a way to simply apply the category dropdown to that and populate the field accordingly (wishful thinking, I'm sure).


texts:
The store Base currency is in CAD$, and allowed currency is $USD. Custemers can see prices on store front in Both currenceis but when checkout credit card/paypal are charged in CAD$, since it base.

The issue arrises when customers chooses USD$ and goes to checkout, right until the last step they see the following:

Subtotal: USD $100
Shipping: USD $5
Grand Total: USD $105
**Your Credit card will be charged **CAD$140**

What is the best way to go around this issue Your Credit card will be charged **CAD$140 since its misleading, customer was shopping in USD and now they get charged in CAD$

I would like to make it so the moment customers go to checkout their USD prices are converted to CAD and either show BOTH values in the checkout or only show CAD$ as the only value, exclude the USD$.

The another issue, if customer checkout out in USD$ and their card/paypal get charged in CAD$. The invoice generated in Magento are still in USD$ and do not mention anywhere about original CAD$ charge towards credit card.

For example, when  you shop on Shopify in currency other than base, once you click checkout all prices are mentioned in the base currency.


texts: how to get associated products id from checkout_cart_add acition in magneto

texts:
using observer after add to cart i am getting this

 Array (
     [uenc] => aHR0cDovL2NpdHl0ZWNoLmxpbnV4c2VydmVyLmNvbS9saWNodGJveC9kcm9wLWFwLXBsLTQ1Y20tNjBjbS5odG1s
     [product] => 33890
     [form_key] => kcKeJzvsx2gsdJsE
     [related_product] =>
     [super_attribute] => Array
         (
             [278] => 2707
         )

     [qty] => 1 )

from this how can i get simple product id which are post to add to cart


texts:
i'm having a strange tax issue on a specific produtc.
After the product is being ordered, on the order details, the tax amount is filled correctly (23%) but the tax percent is at 0% - this causes some customer issues when they see the value greater than 0 and the percent at 0
For the rest of the products everything is ok and works as expected.
Can someone help me find the root of this issue.
Below is the order details
Order Details Section
Regards


texts:
I am trying to fetch the product links for a product, but all return as null or zero. Even though, the product links are shown on the admin UI.

1: Use ProductLinkRepositoryInterface

    $prdRepo = $this->objectManager->create('Magento\Catalog\Api\ProductLinkRepositoryInterface');
    if ($prdRepo) {
        $links = $prdRepo->getList($product);
        //This output as 0
        echo 'links='; echo count($links); echo PHP_EOL;
    }

2: Use ProductInterface, getProductLinks() method

$productLinks = $product->getProductLinks();

These two ways return 0.
I am not sure if it is the correct way to fetch the product links.


texts: How to solve Fatal error: Class 'Mage_Eav_Model_Entity_Setup' not found in /includes/src/Mage_Core_Model_Resource_Setup.php error

texts:
Yesterday I changed my index.php file to make it available to the specific IP addresses written in the Developer options of the Admin Panel.
I changed

if (file_exists($maintenanceFile)) {

to

if (file_exists($maintenanceFile)   && !(Mage::helper('core')->isDevAllowed())) {

and moved

require MAGENTO_ROOT . '/app/bootstrap.php';
require_once $mageFilename;

at the top of the changed condition.
My website did what I wanted it to do for the following hours, but when I woke up this morning nothing worked. The error message is

Fatal error: Class 'Mage_Eav_Model_Entity_Setup' not found in /includes/src/Mage_Core_Model_Resource_Setup.php

I set the index.php file like it was before the changes but the problem remains the same.
Is there any way I can fix that?
Thanks.
Cg


texts: Fedex Function ("getRates") is not a valid method for this service

texts:
Im not sure what happened but after we moved to production I noticed that Fedex doesn't work. Magento 1.9.2.4. Here is the latest log, please help

    2016-10-21T19:44:22+00:00 DEBUG (7): Array
(
    [request] => Array
        (
            [WebAuthenticationDetail] => Array
                (
                    [UserCredential] => Array
                        (
                            [Key] => I1giRQJpoGVOaNO9
                            [Password] => yHIvxRuyFXgehdoUPD4xS2HNv
                        )

                )

        [ClientDetail] => Array
            (
                [AccountNumber] => 3--------5
                [MeterNumber] => 1-----1
            )

        [Version] => Array
            (
                [ServiceId] => crs
                [Major] => 10
                [Intermediate] => 0
                [Minor] => 0
            )

        [RequestedShipment] => Array
            (
                [DropoffType] => REGULAR_PICKUP
                [ShipTimestamp] => 2016-10-21T19:44:22+00:00
                [PackagingType] => YOUR_PACKAGING
                [TotalInsuredValue] => Array
                    (
                        [Amount] => 1151.25
                        [Currency] => USD
                    )

                [Shipper] => Array
                    (
                        [Address] => Array
                            (
                                [PostalCode] => 91402
                                [CountryCode] => US
                            )

                    )

                [Recipient] => Array
                    (
                        [Address] => Array
                            (
                                [PostalCode] => 90242
                                [CountryCode] => US
                                [Residential] =>
                            )

                    )

                [ShippingChargesPayment] => Array
                    (
                        [PaymentType] => SENDER
                        [Payor] => Array
                            (
                                [AccountNumber] => 3-------5
                                [CountryCode] => US
                            )

                    )

                [CustomsClearanceDetail] => Array
                    (
                        [CustomsValue] => Array
                            (
                                [Amount] => 1151.25
                                [Currency] => USD
                            )

                    )

                [RateRequestTypes] => LIST
                [PackageCount] => 1
                [PackageDetail] => INDIVIDUAL_PACKAGES
                [RequestedPackageLineItems] => Array
                    (
                        [0] => Array
                            (
                                [Weight] => Array
                                    (
                                        [Value] => 13
                                        [Units] => LB
                                    )

                                [GroupPackageCount] => 1
                                [InsuredValue] => Array
                                    (
                                        [Amount] => 1151.25
                                        [Currency] => USD
                                    )

                            )

                    )

            )

    )

[result] => Array
    (
        [error] => Function ("getRates") is not a valid method for this service
        [code] => 0
    )

[__pid] => 24137

)


texts: How can i call phtml file into cms page by using widget?

texts:
I have a phtml file mw/news/slider.phtml.

I would like to use this file at cms page.

So how can i do this by using widget ?


texts:
I am getting these errors by creating error memo programatically
Creditmemo Document Validation Error(s):

A creditmemo can not be created when an order has a status of closed.
The quantity to creditmemo must not be greater than the unrefunded quantity for product SKU "S312179".
The credit memo's total must be positive

Code -
public function createCreditMemoByFilteredOrder($order_id)
    {
        $mageOrder   = $this->orderFactory->create()->loadByIncrementId($order_id);
        $invoiceColl = $mageOrder->getInvoiceCollection();
        foreach ($mageOrder->getInvoiceCollection() as $invoice) {
            $invoiceId = $invoice->getId();
        }
        try {
            $invoice = $this->invoiceRepository->get($invoiceId);
        } catch (\Magento\Framework\Exception\NoSuchEntityException $ex) {
            return;
        }

        $invoiceItems       = $invoice->getItems();
        $items              = [];
        $orderId            = $invoice->getOrderId();
        $creditmemo_product = 'S312179';
        $qty_to_refund      = '1';

        foreach ($invoiceItems as $invoiceItem) {
            $productId  = $invoiceItem->getProductId();
            $invoiceSku = $invoiceItem->getSku();
            /**
             * If product id match then create Credit memo for that order
             */
            if ($productId === $creditmemo_product) {
                $creditmemoItemCreation = $this->CreditmemoItemCreationFactory->create();
                $items[]                = $creditmemoItemCreation->setQty($qty_to_refund)
                    ->setOrderItemId($invoiceItem->getOrderItemId());
            }
            /**
             * Create Credit Memo
             */
            if ($this->refundOrder->execute($orderId, $items, true, false)) {
                $result[0] = true;
                $result[1] = $order_id;
                $result[2] = $row;
            } else {
                $result[0] = false;
                $result[1] = 'Could not create credit memo for Order ID "' . $order_id . '" for row no: ' . $csvRowCounter;
            }
        }
    }

Any thoughts, what is missing ?


texts:
Magento language switching invalid:

Click Chinese :
http://127.0.0.1/porto/vendors/index/login/?___store=english&___from_store=cn => display English
Click English :
http://127.0.0.1/porto/vendors/index/login/?___store=english&___from_store=cn
=> Display Chinese

My store configuration is set to:

default config: Chinese
main website: Chinese
english store: English
chinese store: Chinese


texts: 'Unsupported data type N' after patching SUPEE-10415

texts:
after patching SUPEE-10415,
saving products in backend causes an error,

Unsupported data type N

does it have to do something with the database?
maybe some settings there?

any advice would be really helpfull


texts: Changing price format from RON30.00 to 30.00 RON

texts: I'm trying to achieve this change. I've searched everywhere and found nothing. Is it possible to reorder the pricing format ?


texts: Is it possible to not have the images popping out of their frame and filling the whole page when I click on them? I would like nothing at all to happen when you click on the image in the product page.


texts: Create new customer not redirect to My account after Magento upgrade to 1.9.3.4

texts:
I have upgraded to Magento 1.9.3.4. Everything working fine only after create a new customer it's not redirecting to My account page. It is redirecting to Home page and showing notification that your account is created on Home page.

I want to redirect it to My account page of customer.