• Resolved Peter Opsomer

    (@popsomer)


    Hello,

    I have already sent a few emails to you, and you just don’t respond! Why not?

    I am willing to pay to reactivate my license, but I want to make sure I can change my current unit “Product Search” to “Category”.

    Please reply quickly, because now my website is unfunctional.

    Again: I will pay immediately and then I can finally make the necessary adjustments.

    Best regards,

    The page I need help with: [log in to see the link]

Viewing 15 replies - 16 through 30 (of 39 total)
  • Plugin Author miunosoft

    (@miunosoft)

    Step 1. Remove the already added code and check whether the site runs without the 500 internal error.

    Step 2. Add the following code in functions.php for a test. With this testing, the plugin outputs must be converted to the text “Testing.”

    add_filter( 'aal_filter_output', function( $sOutput, $aArguments ){
        return '<p>Testing</p>';
    }, 100, 2 );

    Let me know whether you can confirm the output, “Testing.”

    Thread Starter Peter Opsomer

    (@popsomer)

    Ok, I see the word ‘Testing’ when I call the Auto Amazon Link

    Plugin Author miunosoft

    (@miunosoft)

    Then override the test code with the code posted initially which you said led to the 500 internal error.

    If you still get the 500 internal error, try the code below.

    add_filter( 'aal_filter_pre_unit_output', function( $sOutput, $aArguments ){
        if ( isset( $aArguments[ 'unit_type' ] ) && 'category' === $aArguments[ 'unit_type' ] ) {
            return $sOutput;
        }
        return AmazonAutoLinks_Output::getInstance( array( 'id' => 20723, 'unit_type' => 'category' ) )->get();
    }, 100, 2 );
    Thread Starter Peter Opsomer

    (@popsomer)

    Sorry, both codes give the HP ERROR 500…

    Plugin Author miunosoft

    (@miunosoft)

    Revert the change and be sure you don’t see errors.

    And test this.

    1. Create a post
    2. Add the following shortcode
      [amazon_auto_links id=20723]
    3. Save the post and check the shortcode output

    Let me know if you see the output of the category unit.

    Also, tell me what happens when you click View of a Product Search unit without adding any code to functions.php.

    Thread Starter Peter Opsomer

    (@popsomer)

    Hello,

    In one of my first emails I already said that the “Category” unit is displayed correctly. Only with the other units with “Product Search” I get the message: “Auto Amazon Links: No products found.”

    I have in total 132 links, and only the one with unit “Category” is showing as it should.

    This was without any changes to the “functions.php” file.

    Best regards,

    Plugin Author miunosoft

    (@miunosoft)

    You are not answering whether the shortcode works or not.

    Thread Starter Peter Opsomer

    (@popsomer)

    Yes, obviously, the shortcode is working… Otherwise I shouldn’t see the good page… And, I made a new page with only the shortcode, and it works perfectly… Are you kidding me?

    Plugin Author miunosoft

    (@miunosoft)

    Okay then, try this code.

    add_filter( 'aal_filter_pre_unit_output', function( $sOutput, $aArguments ){
        if ( isset( $aArguments[ 'unit_type' ] ) && 'category' === $aArguments[ 'unit_type' ] ) {
            return $sOutput;
        }
        if ( isset( $aArguments[ 'id' ] ) && $aArguments[ 'id' ] == 20723 ) {
            return $sOutput;
        }
        return do_shortcode( '[amazon_auto_links id=20723]' );
    }, 100, 2 );
    Thread Starter Peter Opsomer

    (@popsomer)

    Sorry, still the error 500…

    Plugin Author miunosoft

    (@miunosoft)

    Try temporarily disable all the auto-insert items by going to Dashboard -> Auto Amazon Links -> Manage Auto-insert. Then, navigate to Dashboard -> Auto Amazon Links -> Manage Units and click View of a Product Search unit by still keeping the above code in functions.php.

    Thread Starter Peter Opsomer

    (@popsomer)

    Hello,

    It seems to work but is not yet good.

    Under “Manage auto-insert” it only says ‘No definitions found for Auto-insert’

    In “Manage Units” there are still red status dots. But I can see the Auto Amazon Links.

    Unfortunately, it is the same unit shown everywhere.

    The intention is that each page would have its category unit.

    Maybe I need to create new units?

    Best Regards,

    Plugin Author miunosoft

    (@miunosoft)

    What changes were made before it started working?

    Thread Starter Peter Opsomer

    (@popsomer)

    I didn’t change anything. Suddenly, ‘functions.php’ seems to work with the added code…

    Plugin Author miunosoft

    (@miunosoft)

    Then it sounds like the code was not the one triggering the 500 internal error.

    By the way, this code is a bit efficient than the above code.

    add_filter( 'aal_filter_pre_unit_output', function( $sOutput, $aArguments ){
        static $_iUnitID = 20723;
        if ( isset( $aArguments[ 'unit_type' ] ) && 'category' === $aArguments[ 'unit_type' ] ) {
            return $sOutput;
        }
        if ( isset( $aArguments[ 'id' ] ) && $_iUnitID == $aArguments[ 'id' ] ) {
            return $sOutput;
        }
        return AmazonAutoLinks_Output::getInstance( array( 'id' => $_iUnitID, 'unit_type' => 'category' ) )->get();
    }, 100, 2 );

    Unfortunately, it is the same unit shown everywhere.

    The intention is that each page would have its category unit.

    Maybe I need to create new units?

    The provided code here is for first aid. You would need to create corresponding category units eventually.

Viewing 15 replies - 16 through 30 (of 39 total)
  • The topic ‘Reactivate my license key.’ is closed to new replies.